Skip to Content Skip to Menu

Dropdown List of States

  • adhillon
  • adhillon
  • OFFLINE
  • Posts: 77
  • Thanks: 5
  • Karma: 1
4 days 9 hours ago #340696 by adhillon
Dropdown List of States was created by adhillon
How could we insert a Country and State dropdown list in the registration form? The requirement is for listed States to be dependent on the Country selected. For example, we want a list of States in Canada displayed if country Canada is selected. 
Are there built-in lists available or do we have to create the lists manually?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48991
  • Thanks: 8373
  • Karma: 1454
4 days 7 hours ago #340705 by krileon
Replied by krileon on topic Dropdown List of States
That's doable using CB Query Field in combination of CB Core Fields Ajax. Since you've CBSubs this makes things easier as you'll be able to use its database tables for this. The below should work.

Field: cb_country
Type: Query Drop Down (Single Select)
Parameters > Query
Query:
Code:
SELECT `country_iso_code2`, `country_name` FROM `#__comprofiler_countries`
Parameters > Options
Value Column: country_iso_code2
Label Column: country_name

Field: cb_state
Type: Query Drop Down (Single Select)
Parameters > Query
Query:
Code:
SELECT `province_iso_code`, `province_name` FROM `#__comprofiler_provinces` WHERE `country_iso_code2` = '[cb_country]'
Parameters > Options
Value Column: province_iso_code
Label Column: province_name
Integrations > CB Core Fields Ajax
Update On: cb_country

That should do the trick. Selecting country should reload the state dropdown for states relevant to that country.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • adhillon
  • adhillon
  • OFFLINE
  • Posts: 77
  • Thanks: 5
  • Karma: 1
4 days 5 hours ago #340710 by adhillon
Replied by adhillon on topic Dropdown List of States
If possible, we would like to tweak the default behavior and avoid complicating the equation. 
The Registration workflow is currently as follows:
Step 1: Signup (step1.png)
Step 2: The first step leads to the payment basket.  (step2.png) where the guest can Edit Billing Address and Subscribe. 
Step 3: Clicking the 'Edit Billing Address' link provides the functionality that we seek (step3.png).
Step 4: shows the final payment screen (step4.png).

We would like the workflow to be as follows:
Signup button from step-1 leads to step-3 automatically, bypassing step2.png.
When Billing information is updated, it takes the guest to step4.png. 

Please advise.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48991
  • Thanks: 8373
  • Karma: 1454
4 days 4 hours ago #340711 by krileon
Replied by krileon on topic Dropdown List of States
I don't recall if this is still the case, but if you set "Invoicing address handling at payment time" to "Mandatory invoicing address" within CBSubs > Settings > Display > Invoices I believe it should show invoice address page before basket page. Alternatively you can create fields to fill out that information, display them on registration, then in CBSubs > Settings > Display > Invoices configure those invoice address fields to default to your CB fields so it pre-fills the billing address.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum