Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

[SOLVED] Query fields dependancy question (country - state)

  • liaskas
  • liaskas
  • ONLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
5 years 1 month ago - 5 years 1 month ago #314822 by liaskas
Registration process. No user yet.

Table name "country_info"


2 Fields:

a) cb_country
We use this query: SELECT DISTINCT `country` FROM `country_info` ORDER BY country
Everything shows fine! No problem to select the country.


b) cb_state
Here we need to show all states of the selected country in the previous field. So we try like this:
SELECT DISTINCT `state` FROM `country_info` WHERE `country` = '[cb_country]' ORDER BY state
No way...
The pull down field is empty.

If we change the (`country` = '[cb_country]') part of the query with (`country` = 'Andorra') for example... the field works and shows the Andorra states. So we believe that there is something wrong with the '[cb_country]' part.


Can you please advise?

Thank you in advance...
Attachments:
Last edit: 5 years 1 month ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
5 years 1 month ago #314837 by krileon
You need to have CB Core Fields Ajax installed then under Integrations > CB Core Fields Ajax of your State field select your Country field for Update On. This will cause the state field to refresh when Country changes and will result in your substitution working based off your current selected 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.

  • liaskas
  • liaskas
  • ONLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
5 years 1 month ago #314849 by liaskas
Forgive me i forgot to mention.

CB Core Fields Ajax is already installed and set but the result is no choices inside the states pull down menu.

Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
5 years 1 month ago #314855 by krileon
Is this during profile edit or registration? frontend or backend? Ensure CB Core Fields Ajax it self is public and published in CB > Plugin Management. Ensure within CB > Configuration > User Profile that "Profile View Access Level" is set to something your users can actually access as it can block ajax endpoints. You should see a loader icon appear next to the State field when your change the value of your Country field.


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.

  • liaskas
  • liaskas
  • ONLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
5 years 1 month ago #314864 by liaskas

Is this during profile edit or registration? frontend or backend?

Registration, Frontend

Ensure CB Core Fields Ajax it self is public and published in CB > Plugin Management.

Published and public!

Ensure within CB > Configuration > User Profile that "Profile View Access Level" is set to something your users can actually access as it can block ajax endpoints.

We are talking about the Registration process. No profile yet to have "Profile View Access Level"

You should see a loader icon appear next to the State field when your change the value of your Country field.

No... no loader shows when changing Country field.

What i see is this...
Before country select...


After country select...
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48551
  • Thanks: 8291
  • Karma: 1445
5 years 1 month ago #314867 by krileon
Please PM backend super administrator login credentials and will take a look. Some reason the jQuery is failing to function or load to perform the ajax call.


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