I am trying to: I have ACF installed with "Product Facets". I added those custom fields to a Page. Based on the selection of those fields (see screenshot), I would like to have the Page output the results. So if Bracelets and Amber are selected, the page outputs the products that match.
Thanks.
I visited this URL:
I expected to see:
Instead, I got:
Dear Daniella,
I suggest you setup a view to filter with shortcode attribute,
when you put the view into content, set the attribute value maually, for example:
[wpv-view name="houses" bracelets ='[wpv-post-field name="bracelets "]']
See our document:
Controlling the filter with shortcode attributes
https://toolset.com/documentation/user-guides/passing-arguments-to-views/
Yes, I understand the shortcodes, but is there a way to avoid adding the shortcodes and just have the page display what checkboxes are selected?
Since you are requesting filter the view by custom fields value of current page, Views needs to know what value it is, so you will need pass the custom fields value to Views. according to our document:
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/
section "Source for compare value"
The easiest way without PHP code is using "Shortcode attribute": The value for the filter comes from an attribute in the View shortcode
Also you can specific the values by Views filter hook "wpv_filter_query" to apply such a filter:
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/
wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
Hope it help