[SOLVED] mapping of address fields to CBSubs not working

6 years 9 months ago - 6 years 8 months ago #295153 by cpaschen
We have all of our user profile billing address fields to set to required.

We have the CBSubs > Settings > Display > Invoices set to map those fields into the invoice address fields.

However, when we go through the checkout process these fields are not getting transferred from the user's profile into the billing/invoice address fields.

In addition, on the initial display of "This is your invoicing address" display/form on the front-end during checkout, the 'State/Province' is not showing any states available. It just shows 'Click to select'. I have to select a different country, then re-select the proper country for the state list to get populated.

But these really should all be populated by the core profile fields.

Is there some plugin that handles that that might not be enabled?

NOTE: Some of the fields on our profile are actually query fields that return ID numbers (for company name, country, state, etc.). I've tried using both the initial direct fields to map to the billing address as well as creating additional query fields that directly display the 'name' of the item (company, country,etc) and tried mapping those as well. Neither options seems to actually map the profile fields to the billing address - the fields are always empty.

BTW ... I did look through the CBSubs manual and didn't find anything specific related to maping these fields. If there is something there that I missed please point me to the proper section or page number.

Please Log in to join the conversation.

6 years 9 months ago - 6 years 9 months ago #295164 by krileon
Only stored fields will map. So your query fields won't map (query select will map fine as they store their values). Invoice fields also only map 1 time then never again. If you want them to map all the time and from query fields you'll need to use CB Auto Actions to do that on the after registration and after profile update triggers using a Field action (the invoice fields are stored in hidden CB fields).

Note the country field expects the full country name and not the 2 or 3 character ISO.

In addition, on the initial display of "This is your invoicing address" display/form on the front-end during checkout, the 'State/Province' is not showing any states available. It just shows 'Click to select'. I have to select a different country, then re-select the proper country for the state list to get populated.

This is a known issue.


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 to join the conversation.

6 years 9 months ago #295175 by cpaschen
Thanks that is very helpful to get to a working solution. However, I have a few more questions to help me understand how to make this work.
Basically, we just want to make sure that the 'billing address' fields that we collect will populate the address fields for the payment gateway (i.e. authorize.net).

When you say "Only stored fields will map." Do you mean fields of the 'type' that are able to be stored? Or fields that are of the 'type' AND have already been stored (i.e. already committed to the db)?

The field that we have for 'cb_billingcountry' is a Query Drop Down (Single Select).

And the query is :

SELECT `common_name`, id
FROM custom_organizations_countries
ORDER BY `ordering`, `common_name`

With `common_name` returned as the 'Label Column' and `id` returned as the "Value Column'. And `common_name` is the ISO standard common name for the country.

We also use this type of field for the company as well as the state (returning the full state name).


Should these fields be working? Or is the problem with the fact that we are saving the `id` (a number, not name) an issue?

Please Log in to join the conversation.

6 years 9 months ago #295180 by krileon

When you say "Only stored fields will map." Do you mean fields of the 'type' that are able to be stored? Or fields that are of the 'type' AND have already been stored (i.e. already committed to the db)?

By stored fields I mean fields that stored in the _comprofiler table. A query field (not query select) for example has no storage and is basically what we call a "calculated" field as its value is generated on display. However, with CB Auto Actions you can also map calculated fields simply by substituting them in.

Should these fields be working? Or is the problem with the fact that we are saving the `id` (a number, not name) an issue?

Query select fields will work fine as their values are stored. The only difference between query select and regular select is the dropdown options come from a custom query.


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 to join the conversation.

6 years 8 months ago #295535 by cpaschen
We've managed to get everything mapped properly; however, we are still having an issue with the previously noted state display:

In addition, on the initial display of "This is your invoicing address" display/form on the front-end during checkout, the 'State/Province' is not showing any states available. It just shows 'Click to select'. I have to select a different country, then re-select the proper country for the state list to get populated.


Where you stated

This is a known issue.


Is there a fix planned, or a work-around possible?

We have tried to 'un-map' the country field but it still doesn't work.

This is a critical issue as novice users (which is most of this site's users) can't figure this out and we're having frustrated users (and potentially loosing sales).

Is it possible to get a fix (or a workaround) somewhat quickly?

Please Log in to join the conversation.

6 years 8 months ago - 6 years 8 months ago #295537 by krileon
As long as the values are properly mapped you won't hit a validation issue and it shouldn't be a problem to skip needing to edit the invoice address entirely. For the Country value you need to map the full country name. So if it's US you need to store United States. For State/Province you need to store the state ISO prefixed with the country ISO. So for example I'm in Georgia so the state would be US-GA.

The easiest way to reliably map those values is to use a Query Select and build a dropdown from the _comprofiler_countries and _comprofiler_provinces tables that CBSubs Tax integration provides. The below Query Select usages should do this.

Country
Query:
SELECT `country_name`, `country_region`
FROM `#__comprofiler_countries`
ORDER BY `country_region`, `country_name`
Value Column: country_name
Label Column: country_name
Group Column: country_region

State/Province
Query:
SELECT p.`province_iso_code`, p.`province_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 p.`province_latin_name`
Update On: cb_country (note this usage is replaced by CB Core Fields Ajax "Update On" and will be removed in CB Query Field 6.0.0)
Value Column: province_iso_code
Label Column: province_name
Group Column: (empty)

Note the above state query expects the country to be in "cb_country" field; adjust as needed.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.245 seconds

Facebook Twitter LinkedIn