Skip to Content Skip to Menu

Country field prefilled in mandatory invoicing address [Closed]

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
1 year 11 months ago #331439 by agaudin
Hello,

I am using CBSubs, and to be compliant with bank wishes I set the system to "Mandatory invoicing address".

To ease the client's process, I also set correct relationships between CBuilder fields and invoice fields (example : cb_myaddress --> address), and it works fine...

EXCEPT for the country : as all my subscribers are in France, I created a cb_country field preset on "FR" but it doesn't work. I tried with a CBuilder text field, with a dropdown field ; I tried to display or to hide it, etc etc. Nothing worked.

Any suggestion ? It is not blocking (people can choose "France - FR" by themselves with the native CBSubs invoicing system, but it is frustrating...

Best regards,

Antoine

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 11 months ago - 1 year 11 months ago #331442 by krileon
The below is example of how to build country and state selection using CB Query Field with a Query Select and CB Core Fields Ajax with its Update On feature.

www.joomlapolis.com/forum/developer-members-support/240757-query-drop-down-single-select-displaying-value-not-label-after-update?start=6#311513

This example uses the CBSubs database tables so it should map to the invoice fields properly.

Another thing to consider is do you need those fields on their profile? If not I'd only ask for them in the basket as part of the billing process and not bother with having them on profile. CBSubs does store the billing address to hidden CB fields so it is possible to get their values via substitutions if you do need them for some sort of display. Typically I recommend registration be as minimal as possible to reduce friction. See our registration for a minimalistic example.


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.
Last edit: 1 year 11 months ago by krileon.

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

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
1 year 11 months ago #331445 by agaudin
Hello

Thanks for your quick answer. I red the topic you mentionned, but I am not sure it how it could help me. I don't want to populate a dropdown list, but just prefill with "France (FR)" the dropdown contries list in billing address screen :

Instead of blank one
 

I would like to show directly
 

I tried to use a cb_country field prefilled with FR - I tried a text field, a dropdown field, a radio field, a request field... without beeing successfull.

It works fine for other billing fields
 

I think it is because a dropdown needs selected="selected" on the targeted value to be prefilled, which I cannot performed for now.
Any idea on how to perform that ?
Also I agree that it is best to hide this cb_country field, to ease the process as possible, as you suggested.
Best regards
Antoine

 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 11 months ago #331454 by krileon
To prefill the billing address fields you need to map existing fields to them in CBSubs > Settings > Display > Invoices. To do that you need a Country field that matches the values CBSubs expects. That topic explains how to have a field that matches the values CBSubs expects so they can be mapped over.

Your alternative is just get rid of cb_country and only worry about collecting country in the billing address of their basket if you don't need cb_country for anything else.


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.

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 82
  • Thanks: 16
  • Karma: 3
1 year 11 months ago - 1 year 11 months ago #331460 by agaudin
Thanks for your answer. As I said, I mapped existing CBFields with billing fields, and it works fine for all of them, EXCEPT for the country field. As I don't need it elsewhere, I could leave people choose it in billing address screen, but it is annoying because you have to scroll dozen of countries before finding France - that's why I find think frustrating not to be able to map the country field and would like to get it.

Another solution is to hack / override the CBSubs file with countries list and remove all countries except France-FR. But as you can imagine I would prefer to find a correct way to set it with a dedicated field.

Anyway, if it is not possible, too bad, but not dramatix as it still works.

Regards

Antoine
Last edit: 1 year 11 months ago by agaudin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
1 year 11 months ago #331463 by krileon
Your country field mapping doesn't work because you're sending a value to CBSubs that it doesn't expect. CBSubs expects the country_name value from the _comprofiler_countries database table.

However if you do not need cb_country or any of your other address fields for anything other than sending to CBSubs my recommendation is to remove those fields and just let them fill them in when they first make a purchase. This should reduce what information you need to ask during the initial registration form reducing user friction.


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.
The following user(s) said Thank You: agaudin

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

Moderators: beatnantkrileon
Powered by Kunena Forum