Hi,
sorry, by fix it I meant restore in your code the initialization of the the_ajax_script as in the previous version.
(of course I did not mean you fix the BeRocket JS code…)
M
There aren’t any references to the_ajax_script
in Relevanssi. Relevanssi doesn’t initialize it or use it in any way.
I tried reproducing this problem with the free version of Advanced AJAX Product Filters, but I couldn’t. I did have other problems with it that caused database errors, but nothing with the_ajax_script
.
Are you sure this problem is related to Relevanssi? How could I reproduce this problem?
Hi,
I simply updated Relevanssi to the latest, and the BeRocket filters disappeared from the sidebar since they were all empty, with the JS console on Google Chrome giving me the error. Hence I assumed Relevanssi was the culprit 🙂
After I restored the previous version of Relevanssi, all went back to be fine.
I also tried the BeRocket Advanced setting ‘Fix Ajax issues’, which removed the JS console error, but still the filters were not visible, still empty.
I use the latest version of the BeRocket PRO plugin.
Not sure how you can reproduce it….
What DB errors did you get?
TY
Ok, I think the DB error may be more relevant, and the Javascript error may just be a byproduct.
Try adding this to a snippet:
add_action( 'init', function() {
remove_filter( 'woocommerce_get_filtered_term_product_counts_query', 'relevanssi_filtered_term_product_counts_query' );
}, 9999 );
This is a new fix for the WooCommerce layered navigation introduced in the latest version, and it looks like it may break Berocket filters.
Man you are good!
spot on…
will you work on a permanent fix on your side, or do I add the snippet to all my sites?
absolutely love the combination of Relevanssi and BeRocket, so they need to coexist 🙂
TY
M
I just released the new version today, so in any case, I’m not doing a bug-fix version immediately for something this minor on the large scale of things.
What you can do is replace the /lib/compatibility/woocommerce.php
file in Relevanssi with this file. This includes the fix in the next version of Relevanssi.
Awesome, thanks!!!
so I understand: this fix was to allow the default woo filters to work with Relevannsi search results, right?
M
Yes, the Woo filters didn’t match Relevanssi results. With this change, they do. Looks like BeRocket just works with Relevanssi.
Hi,
Yes, BeRocket filters plugin do have direct integration with Relevanssi.
@msaari do we need to update our code in any way? We could probably update the integration for this issue but function relevanssi_filtered_term_product_counts_query
don’t have any hooks to overpass it.
Regards,
Dmytro
and I can honestly say the combination of the two is the best and most powerful search / filter combo out there.
fantastic work both
but plz plz plz keep it 100% compatible across new releases… I almost fainted this morning…
M
Dmytro, the function itself doesn’t have any hooks in it. It doesn’t need to because it’s a simple function hooked into another hook. If you need to do something about it, you can unhook it or add your own function to the same hook after it.
If you want to do something, you can always unhook the function:
remove_filter( 'woocommerce_get_filtered_term_product_counts_query', 'relevanssi_filtered_term_product_counts_query' );
But starting from Relevanssi 4.17.1, this function will look if the BeRocket_AJAX_filters_version
constant is defined and if it is, the function will do nothing.
Yay, so glad I found this post – I had the exact same issue and replacing the woocommerce.php file sure did fix it – thanks!
What about the pro version of Relevanssi ? Still having issues..
The code is the same in both versions. The fix will be included in the next version for both, and meanwhile, you can use the fix above, i.e. replacing /lib/compatibility/woocommerce.php
in Relevanssi with this file.