Hi!
Thank you very much for the proper details, it helps me a lot.
So the process fails during the post-process, and I was able to deduct that it is related to product variations. I see you have the custom ajax handler enabled as well. My guess is that there might be some sort of issue getting some of the product variation data, or a class/function might not work with this handler.
Can you please try turning this option off, and check if that changes anything: https://i.imgur.com/jqWg6Rj.png
You will have to clear your site cache after making this change.
Another possibility is to not search the product_variation custom post type, but that of course depends if you need those as results, or not.
Hi and thanks for your help!
I already tried disabling the custom ajax handler but it didn’t help.
So… i played with search options on the search field, and if i disable searching in title it works and finds the products! So i went to general options, sources and basics and disabled product_variations and it now works, although i don’t get product variations results 🙁
One more info, i didn’t update WooCommerce to the latest version yet, i’m still using 2.6.14 because i have several plugins that i’m not sure will work wit WooCommerce 3.x.
Could searching in title have anything to do with the issue or do you think it has something to do with WooCommerce version? I can even try to use an older version of Ajax Search Lite, because i’m not sure when this issue started…
What do you recommend and thank you very much for your help!
Hi,
I think I know what the problem is then. There is a function used to get the product variation link, that might not be available in older WooCommerce versions, I’m not sure.
Anyways, could you please try the following modification:
– Open up the wp-content\plugins\ajax-search-lite\includes\classes\search\search_content.class.php file on your server.
– Scroll to line 659, which should be this:
if ( $r->post_type == 'product_variation' && class_exists( 'WC_Product_Variation' ) ) {
– Change that to:
if ( $r->post_type == 'product_variation' && function_exists('wc_get_product') ) {
– Save the file.
Let’s hope that changes something.
Hi there!
Unfortunately it didn’t help 🙁
When i have some time i’m going to update WooCommerce to the latest 3.x version and see if that helps, until then i’ll just disable product variations from the search.
Thanks again and i’ll report here when i have more info!