This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: The request failed. Please check your connection! Status 500

Home Forums Product Support Forums Ajax Search Pro for WordPress Support The request failed. Please check your connection! Status 500 Reply To: The request failed. Please check your connection! Status 500

#18528
Ernest MarcinkoErnest Marcinko
Keymaster

You are welcome 🙂

Sure, let me explain.
– Under the General Options -> Sources 2 panel, there were some taxonomies selected to be returned as results
– The variable $r->id contains the result ID, for posts it is the post ID, for taxonomy terms it is the term ID etc..
– While the taxonomy terms were enabled as results, your code only checked if the $r->id existed with isset($r->id), which was true in almost all cases
– The issue happened whenever the template was rendering a taxonomy term object, and the wc_get_product( $r->id ); returned an error and the code stopped. The $r->id in this case was a term ID, not a product ID, and that is the source of the problem.

With the addition, it does not matter how you change the configuration, the custom code always checks first, if the actual result is indeed a product.

I hope this clarifies it a bit 🙂