CBSubs invoice fields problem

1 week 3 days ago - 1 week 3 days ago #315497 by liaskas
Hello...
we have managed to set the Countries and states list on cb registration to populate the same values with CBSubs invoice Country and states list. For this we used 2 query fields.

One is calling the country list with this query:
SELECT `country_name`, `country_region`
FROM `#__comprofiler_countries`
WHERE `country_region` != ''
ORDER BY `country_name`
The other is calling the states list with this query:
SELECT p.`province_latin_name`, p.`province_iso_code`, c.`country_name`
FROM `#__comprofiler_provinces` AS p
LEFT JOIN `#__comprofiler_countries` AS c
ON c.`country_iso_code2` = p.`country_iso_code2`
WHERE c.`country_name` = '[cb_country]'
ORDER BY c.`country_name`, p.`province_latin_name`

This works fine for us. All set, on coutry selection the states show fine etc.

Now we go to CBSubs...

We have mapped the invoice fields to the appropriate #__comprofiler fields where each user's data are stored.
All the mapped fields are populated fine, but not the field that has the user's state. The record exists in this field but it is not populated.

Instead, it shows the dropdown selection with the pre-selected country states. And here is the point...

We noticed that the states in the CBSubs invoice "State / Province" field are populated by "province_name" and not by "province_latin_name" column that we use to query the states in cb registration.

Is there a posibility that the "State / Province" field is not populated because of this difference?

How will we set the "State / Province" field to populate values from "province_latin_name" column?

Thank you in advance!
1 week 3 days ago #315505 by krileon
State in CBSubs is stored as COUNTRY_ISO-STATE_ISO. More specifically it's the province_iso_code of the _comprofiler_provinces table. So you'll need to be sure that that column is set as the value for your query select field. Now for country it's a little different. That's stored as the country name so you'll need to use the country_name column in _comprofiler_countries as the value for country query select. CBSubs is supposed to be able to handle translating the supplied values to the necessary values, but it doesn't work as reliably as it should and we've a ticket already to improve this.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
1 week 3 days ago #315509 by liaskas
So if i understood good....

i have to query the province_iso_code of the selected state in a field (for example cb_province iso code) and then map the "State / Province" to that field?

Please advise...

Thank you.
1 week 3 days ago #315511 by krileon
Yes, configure the value column for your query select field to use province_iso_code. That should pass to CBSubs fine or at least is the expected value stored in the database that CBSubs will use for state. There's a known bug however with the edit invoice address page not having its initial value set correctly, but it should display correctly when viewing the basket.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
The following user(s) said Thank You: liaskas
Moderators: beatnantkrileon
Time to create page: 0.411 seconds
Facebook Twitter Google LinkedIn