[SOLVED] state dropdown

13 years 8 months ago #140437 by Joe028
[SOLVED] state dropdown was created by Joe028
I am fine tuning the registration pages for my subscription plans. I do have a field that I created for the users State of residence. It is just a text field limited to 2 characters for the abbreviated US state. In the Invoicing options for cbsubs I have set this field to the invoicing address state field.

When I register a user the state field is left blank on the invoice. When I click the "Click here to modify invoicing address" link I see that there is a dropdown box for the state field.

Is there a way to have that state dropdown box on my registration form or as a field in the users profile right from the start?

Thanks

Post edited by: krileon, at: 2010/08/23 22:22

Please Log in to join the conversation.

13 years 8 months ago #140454 by cliffvt
Replied by cliffvt on topic Re:state dropdown
We do exactly the same, and how we do it is to go to:

Components>Community Builder>Field Management and then for the state field we simply ticked the "Show at registration" box to YES

This field now appears on the registration form, and if you then also set

Components>Community Builder>Plugin Management>CB Paid Subscriptions>Settings>Display>Invoices>CB fields for first invoicing address of customer

"State field:" set to the state field you used on registration.

If you wanted to make sure the two fields are exactly in sync (i.e. your "state" field matches the "invoice state" field) then simply open the following file:
components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/xml/edit.front.invoice.xml
Copy the list of states from this file, then amend your "state" field to be a "select" field and ensure that you add all the states found in the xml file as options in your state field.

Hope this helps

Cheers

Cliff

Post edited by: cliffvt, at: 2010/08/22 16:24

Please Log in to join the conversation.

13 years 8 months ago #140481 by Joe028
Replied by Joe028 on topic Re:state dropdown
Thanks for the reply Cliff. I can't seem to nail this down yet though because as far as I can see I have it set up exactly as you describe. A single select dropdown box with all the states from that xml file listed. This is shown on registration. And that field is set to populate the invoice per the cbsubs-display-invoices setting.

After all that, I am still getting a "-" only in the state field. My other fields transfer fine.

Joe

Please Log in to join the conversation.

13 years 8 months ago #140489 by cliffvt
Replied by cliffvt on topic Re:state dropdown
Joe

That is strange as ours works perfectly.

Since reading your post, I have done detailed tests to see under which circumstances it could not work and the only one I could come up with was when the two option tables don't match. i.e. a value is chosen in the registration "state" field that is not present in the "invoice state" field.

If you know how to use phpMyAdmin then you can also do the following to check:

1. Register a new user to one of your plans
2. If it is a paid plan, then immediately after the "register" button is pressed, an invoice screen will appear
3. This is where you say the "-" is appearing?
4. Before doing anything, open the table ???_comprofiler (where ??? is your prefix)
5. Check the contents of your registration "state" field for this new user - it should contain the option that you just entered at the registration page, if not, then that is where your problem could be - check that field setup properly.
6. Whatever is showing in the database table in the registration state field is the value that should be showing on the Invoice state field on screen (although it will still be blank in the database table under the field cb_subs_inv_address_state as you have not yet saved the invoice screen

By the way did you create a BRAND NEW state field after I wrote to you? You cannot modify an existing TEXT field to a "SELECT" field. If you did , this is most probably the problem, create a new one.

PM me your registration form URL as well as your edit.front.invoice.xml file so I can have a look at it if you like?

Cheers

Cliff

Post edited by: cliffvt, at: 2010/08/23 09:45

Please Log in to join the conversation.

13 years 8 months ago #140516 by Joe028
Replied by Joe028 on topic Re:state dropdown
PM is on it's way with the url and the .xml file. I messed with it some more and here are some things I noticed. The field that contains the state field on registration is 'cb_statedrop'. I did create this new and not changed from a text field.

When I check through phpadmin the cb_statedrop field shows correctly from what was inputted during registration. The invoice-state field shows NULL. It is as if the value is is not copying from cb_statedrop to the invoice-state field. I even tried to have it show in the company field, and it didn't. Then I tried several other fields to show in company field, and that didn't work either.

I ran the tools through CB Tools manager and everything checks out ok. For now I am not including the invoice at all, however I would like to implement this on the site if I can get it working.

Thanks,
Joe

Please Log in to join the conversation.

13 years 8 months ago #140517 by Joe028
Replied by Joe028 on topic Re:state dropdown
here is the .xml file

Attachment edit.zip not found



Post edited by: Joe028, at: 2010/08/23 20:06
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.275 seconds