Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Error Searching for Product Categories
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 8 months ago.
- AuthorPosts
- September 23, 2020 at 10:05 pm #29512
When we search for our products like Lipitor, it works great…
When we search for some Product Categories, it also works OK, like Acne or ADHDBut other product categories return an error like Blood Pressure or Cholesterol I get:
“The request failed. Please check your connection! Status: 500”can you please help me?
September 24, 2020 at 9:09 am #29519Hi,
Sure! Can you please add temporary FTP and back-end access? I would like to debug the query. Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 24, 2020 at 9:17 am #29520You cannot access this content.September 24, 2020 at 12:31 pm #29526Thank you!
I think I found the issue. On the General Options -> Sources 2 panel, you had some taxonomy terms selected to be returned as results, which I think you didn’t want. You only needed to search the taxonomies and return the products, so I disabled those option. Now it should work all right.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 24, 2020 at 8:45 pm #29538Thanks, that removed the error, but also removed a function that we want.
We also want to be see a “Category” box when the term searched for matches a category
September 25, 2020 at 1:56 pm #29547Hi,
The issue is caused by a custom code. I cannot tell where exactly it is, I could not find it in the child theme directory. It is probably related to something like this:
add_filter( 'asp_results', 'asp_add_custom_shortcode', 10, 1 ); function asp_add_custom_shortcode( $results ) { foreach ($results as $k=>&$r) { // Enter the shortcode into the quotes section $r->content = do_shortcode('[my_shortoce_here]') . $r->content; } return $results; }
I suspect the “do_shortcode” is not working correctly within the terms context. Try modifying the final code to something like:
Best,add_filter( 'asp_results', 'asp_add_custom_shortcode', 10, 1 ); function asp_add_custom_shortcode( $results ) { foreach ($results as $k=>&$r) { if ( isset($r->post_type) ) { // Enter the shortcode into the quotes section $r->content = do_shortcode('[my_shortoce_here]') . $r->content; } } return $results; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.