Support

  1. jameswadsworth
  2. Support
  3. Sunday, June 23 2019, 08:16 PM
  4.  Subscribe via email
With Easy Profile Select list there is the option to set DB params to get information from a table. Great feature. However we are struggling to understand how the filter database options based on the value of this field works.

We have 2 tables. One that contains a list of countries. The second table contains a list of states. We have created 2 select lists, one for the counties, one for the states. We'd like to be able filter the states in the select list according to the country selected in country list. Is this possible?
Accepted Answer
admin Accepted Answer
Admin
Hi,
unfortunately Select DB feature does not manage something like this, anyway there is a workaround: you can create a view in your database for states:
- Open a tool to manage your database like phpMyAdmin, normally something like this is provided by your hosting provider.
- Launch a query like:
CREATE ALGORITHM = UNDEFINED VIEW `states` AS SELECT a.*,b.zone_parent_namekey FROM bmc9r_hikashop_zone as a,bmc9r_hikashop_zone_link as b WHERE a.zone_namekey = b.zone_child_namekey AND a.zone_type="state";

This will create a dynamic table that contain only states and with columns like #__hikashop_zone plus one more column called "zone_parent_namekey" from table #__hikashop_zone_link
- Now configure your fields like screenshots
Attachments (2)
admin Accepted Answer
Admin
Hi,
sorry for late reply, it was a weekend :D

Yes, this is possible, I suppose you have a tables structure like this:
Table Countries "countries":
country_id (ID of the country)
country_name (Name of the country)

Table States "states"
state_id (ID of the state)
state_name (Name of the state)
country_id (ID of the country associated)

So you need to create 2 select fields, Country and States, and fill options like screenshot.
Attachments (2)
  1. 3 weeks ago
  2. Support
  3. # 1
jameswadsworth Accepted Answer
Pro
Thanks for the reply. We have hikashop installed on the site and we are wanting to get the data from the table #__hikashop_zone. For the list of countries it works fine. However to list the states some information is in another table #-_hikashop_zone_link and requires a left join.

Is it possible with a bit of messing around to get this working?

Thanks
  1. 3 weeks ago
  2. Support
  3. # 2
jameswadsworth Accepted Answer
Pro
That works perfectly. Thanks for your help! :D
  1. 3 weeks ago
  2. Support
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Request Support

Support is currently Online

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy ProfileĀ® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.