Skip to Content Skip to Menu

Community Builder "Country" Field - Best Approach for CBSubs Tax & B2B?

1 day 11 hours ago - 1 day 11 hours ago #343506 by okp-medezide
Hi everyone,

We are building a B2B SaaS platform using Community Builder and CBSubs. We are planning on selling membership access to a wide variety of countries, primarily in Europe, but also globally.

I am currently setting up the CBSubs Tax addon to handle VAT/Tax calculations, and I'm also using CB Auto Actions (via Webhooks/Make.com) to sync customer data to our accounting software (e-conomic).However, I’ve run into a bit of a "architectural" question regarding the Country field. For our setup to work, we need a reliable Country field during registration for:
  1. Displaying the correct country/address on invoices.
  2. Calculating the correct VAT/Tax via CBSubs Tax.
  3. Sending the correct VAT Zone code to our accounting platform.
I’m honestly a bit surprised that there isn't a native "Country" Field Type in Community Builder. I can see that all countries are listed inside the CBSubs Tax configuration, but I don't see a clear way to "connect" that list to a user field.

My questions for the community:
  1. What is the "best practice" for creating a Country field in CB that plays nice with the CBSubs Tax addon?
  2. Does CBSubs Tax look for a specific field name (e.g.,
    Code:
    cb_country
    ), or do I manually map a Dropdown field to the Tax engine?
  3. Is there a way to make this field searchable/filterable (like a Select2 dropdown)? Having users scroll through 250+ countries in a standard dropdown is a conversion killer.
  4. If I have to create a manual Dropdown field, is there a way to "sync" or import the country list from the CBSubs Tax addon so I don't have to manually create 250+ entries and ensure the values match?
I feel like I might be missing something obvious here. Any advice on the most robust "pro" way to handle countries in a B2B SaaS environment would be highly appreciated.

Best regards, Oliver
Last edit: 1 day 11 hours ago by okp-medezide. Reason: linebreaks

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 50243
  • Thanks: 8598
  • Karma: 1470
1 day 9 hours ago #343508 by krileon

I’m honestly a bit surprised that there isn't a native "Country" Field Type in Community Builder.

It was just never necessary since it was only ever used for payment logic it was collected at time of payment. The more fields you add to registration the more friction you create. We'll be reviewing adding a lot more core fieldtypes in CB 3.0 though.

What is the "best practice" for creating a Country field in CB that plays nice with the CBSubs Tax addon?

You can use CB Query Field and the Query Select fieldtype to pull data directly from CBSubs giving an exact matching for synchronization.

Does CBSubs Tax look for a specific field name

It looks for whatever field you've mapped in CBSubs > Settings > Display > Invoices.

Is there a way to make this field searchable/filterable (like a Select2 dropdown)? Having users scroll through 250+ countries in a standard dropdown is a conversion killer.

Yes, CB Query Field and its Query Select can do that.

If I have to create a manual Dropdown field, is there a way to "sync" or import the country list from the CBSubs Tax addon so I don't have to manually create 250+ entries and ensure the values match?

Yes, you can actually just use the database data CBSubs provides with CB Query Field.

The CB Query Field demo below provides a chainable Region, Country, and State/Province field setup. You can login to backend and copy the configuration if you like (cb_region, cb_country, and cb_state fields).

demo.cbdemosites.com/login-as/user?demo=580

You'd just need to swap their queries to CBSubs data and you'd be good to go. You can also just use the below if you like, which is an example of a searchable country field using CBSubs data.

Type: Query
Options > Query
Query:
Code:
SELECT `country_name`, `country_region` FROM `#__comprofiler_countries` [cb:if filter!=""]WHERE `country_name` LIKE '%[filter]%'[/cb:if] ORDER BY `country_region`, `country_name`
Filterable: Enabled
Options > Options
Value Column: country_name
Label Column: country_name
Group Column: country_region

Then in CBSubs > Settings > Display > Invoices set CBSubs to map this field to the country invoice field if you want the two to match.

Also keep in mind the invoice address data is stored to profile fields. They're just hidden fields. Within your database you should see fields prefixed with "cb_subs_inv_". If you just need this for synchronization purposes you can also just use those from the _comprofiler table or you should also be able to substitute them into integrations as well I believe.


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