Facets not ‘stacking’
-
HaikoGParticipant3 years, 11 months ago #14568
Hi,
Currently testing WPSOLR on a Woocommerce shop with more than 25000 products. It’s important to us to be able to select multiple filters; For example brand:Samsung AND color:yellow.
We’re using the “Current theme” template with AJAX with the Facets widget. When I select a brand, the results are filtered for that brand and the counts are updated in the other facets. So I can see there is only one white Samsung for example.
But if I then click the color white, I expect to see that one product, that white samsung. Instead, the brand filter is removed and I get all white products.Can you please explain what I should do to get this working?
Thanks, Haiko
HaikoGParticipant3 years, 11 months ago #14570Thanks for the quick reply
It’s a large list of filters, so I’ll post the ‘Brand’ and ‘Color’ sections
Brand: https://drive.google.com/open?id=165rY_4jt44vwnsnEpjnGhY-h6RZ_Eggf
Color: https://drive.google.com/open?id=1m7v4ZPi0iTv-b20zNSBFV4dLSBVdZ_ZKThis is the entire list:
https://drive.google.com/open?id=1wBGKhyFWeLHTJ7ShU6ibVF4RrmcdLd09HaikoGParticipant3 years, 11 months ago #14574The console shows no errors. Debug log has a warning
trim() expects parameter 1 to be string, array given
Backtrace:
wc_get_template()
wp-content/plugins/woocommerce/templates/taxonomy-product_cat.php:22
do_action(‘woocommerce_after_main_content’)
wp-content/themes/mindig/woocommerce/archive-product.php:84
woocommerce_output_content_wrapper_end()
wp-includes/class-wp-hook.php:286
wc_get_template()
wp-content/plugins/woocommerce/includes/wc-template-functions.php:939
yit_primary_sidebar()
wp-content/themes/mindig/woocommerce/global/wrapper-end.php:41
yit_get_template()
wp-content/themes/mindig/theme/functions-template.php:358
dynamic_sidebar(‘default-sidebar’)
wp-content/themes/mindig/theme/templates/primary/sidebar.php:31
WP_Widget->display_callback()
wp-includes/widgets.php:743
wpsolr\c\c\u\w\WPSOLR_Widget_Facet->widget()
wp-includes/class-wp-widget.php:372
wpsolr\c\c\e\WPSOLR_AbstractSearchClient->get_results_data()
wp-content/plugins/wpsolr-pro/wpsolr/core/classes/ui/widget/class-wpsolr-widget-facet.php:56
wpsolr\c\c\e\WPSOLR_AbstractSearchClient->get_results_results()
wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:950
trim()
wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:2878
wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:2878HaikoGParticipant3 years, 11 months ago #14578Sure, this is the schema
https://drive.google.com/file/d/1Ijikm0pfRXCOwAySj9wWXXy1H6Cx_gay/view?usp=sharingI think it’s coming from WP, because when I click the second filter, the first disappears from the querystring:
First filter querysstring:
?wpsolr_fq%5B0%5D=pa_merk_str%3ASamsungThen after selecting a color, the querystring becomes
?wpsolr_fq%5B0%5D=pa_kleur-van-het-product_str%3AZilver%2C%20WitHaikoGParticipant3 years, 11 months ago #14619Alright, so I’ve created a test index on Elastic search and let it index a couple hundred products. It seems to keep the filters configuration, so it was easy to test
Unfortunately, I see the same result. I’ve made a screencapture for you to see
https://drive.google.com/open?id=1w9hzNGIP1X7faIf2jxJaMg5r8cLXKFB-
Interesting is that the PHP Warning is gone, so that is indeed related to the configuration but it seems not to the problem
- This reply was modified 3 years, 11 months ago by HaikoG.
HaikoGParticipant3 years, 11 months ago #14621Ok, so I found something;
If I change the layout of the filter from checkboxes to select (select2.js and regular) I’m able to “stack” the filters, but only the filters which have the select layout get stacked. The filter from the checkbox is overridden when selecting an other.I do like to use the checkbox layout though, UX wise that makes more sense
You must be logged in to reply to this topic.