I am trying to create search form with depended fields.
Product-Phone
using parent child relationship for brand>Model
storage and color are taxonomies. I don't want all storage options to be displayed in select dropdown. Suppose, A phone has only 3 storage options(8gb, 16gb, 128gb) i don't want extra options to be displayed.
website link:
hidden link
Thanks,
Shabnam
Dear Shabnam,
Is this problem resolved?
I have tried it in your website, if select the options:
Apple-> Iphone 6s, I can see there isn't any other option in dropdown "Storage".
And in your case, you just need to enable the option "Show only available options for each input" in Views custom search settings, see our document:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/
The implemented approach is different is post relationship. I want to change this approach as i need to compare and calculate the fields in view. The output of these select boxes are some ids that cant be used further to compare.
So, i want to replace storage and color with taxonomy with same functionality as it is giving now but when i used taxonomy but it didnt work.
Please guide me.
As I mentioned above:
https://toolset.com/forums/topic/display-only-product-assigned-taxonomies-in-the-dropdown/#post-629454
you just need to enable the option "Show only available options for each input" in Views custom search settings, see our document:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/
Screenshot:
hidden link
And it should be able to work with taxonomy field of Views custom search form, and I can not see the problem in your website:
hidden link
If you still need assistance for it, please try these:
1) deactivate other plugins and switch to wordpress default theme, and test again
2) If the problem still persists, please provide a database dump file (ZIP file) of your website in below private detail box, also point out the problem page URL, I need to test and debug it in my localhost, thanks
Thanks for the details, I have done below modification in your website:
1) Create a view with two filters
hidden link
a) Taxonomy filter
Select posts with taxonomy:
storage taxonomies slug in one of those set by the URL parameter wpv-storage_taxonomies
eg. hidden link
b) Post relationship filter
Select posts that are children of the Post with ID set by the URL parameter wpv-pr-child-of.
eg. hidden link
in section "Custom Search Settings", enable the option "Show only available options for each input"
2) Display it in a page:
hidden link
Please test again, check if it is what you want.
This solution is working fine but there is an issue.
Now if i want to change the phone model it doesn't change without a reset.
Is it possible to have All brands to be visible always other fields can be limited?
Secondly, I have generated output by calculating the fields depending on the search filters. The result is appropriate for all the select fields. The issue starts with the checkboxes as the pass false value when the unselected checkbox is added in the conditional loop.
This one works,
[wpv-calculate]
[types field='[wpv-search-term param='wpv-storage_taxonomies']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-color']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-pa_phone-in-warranty']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-pa_condition']' format='FIELD_VALUE'][/types]
[/wpv-calculate]
Issue with this,
[wpv-calculate]
[types field='[wpv-search-term param='wpv-storage_taxonomies']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-color']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-pa_phone-in-warranty']' format='FIELD_VALUE'][/types]+
[types field='[wpv-search-term param='wpv-pa_condition']' format='FIELD_VALUE'][/types]+
[wpv-conditional if="( '[wpv-search-term param='wpv-pa_accessories']' eq 'box' )]
[types field='box' format='FIELD_VALUE'][/types]
[/wpv-conditional]
[/wpv-calculate]
Also, I don't need 0 to be displayed in output.
I assume the original problem of this thread is resolved:
https://toolset.com/forums/topic/display-only-product-assigned-taxonomies-in-the-dropdown/#post-629391
don't want all storage options to be displayed in select dropdown
For the new questions:
Q1) Is it possible to have All brands to be visible always other fields can be limited?
No, there isn't such a feature, if you agree, we can take it as a feature request.
Q2) the checkboxes as the pass false value when the unselected checkbox is added in the conditional loop.
And
Q3) I don't need 0 to be displayed in output.
They are new questions, I am not sure how do you setup the link and URL parameters, and I have tried to login your website again, but get this error:
ERROR: The password you entered for the username admin is incorrect
Since they are new questions, please create new thread for each new question, describe detail steps to duplicate same problem, that will help other users to find the answers.
Thank you so much for the help Luo Yang.