Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › The request failed. Please check your connection! Status 500
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 11 months ago.
- AuthorPosts
- June 29, 2018 at 2:05 am #18504
Fortunately I was able to get approval from my boss to extend our support coverage. Hopefully you can help me solve it now.
The problem is that after updating the ajax search pro plugin (either this latest version or a recent new one), suddenly only SKU searches work. Searching for a phrase (even the ones that are in the suggested auto complete) never returns a result. It just says “The request failed. Please check your connection! Status 500.”
I have tried deleting and recreating the index, as well as clearing the cache, but nothing seemed to make a difference.
———————————-
Unrelated: when I clicked accept on the privacy notice at the bottom of this report page, it completely reloaded the form and made me fill out the entire thing again. ><
June 29, 2018 at 6:58 am #18505Hi!
Thank you for the details, it helps me a lot.
Unfortunately the FTP is not working, I have tried FTP, FTPS and SFTP methods on numerous clients with no success, I get a connection timeout each time.
Luckily there is some information within the ajax response, the request fails at a cetain point, where the SKUs are about to be displayed within the titles. It looks like you use a custom code or a search theme modification for that, based on the ajax response output, I can’t tell which one though. The error is caused by that and because the taxonomy term search is also enabled. Because taxonomy terms does not have SKUs (nor any other custom fields), WordPress fails at that point. To resolve that you have two options:
1. To disable the search & return of taxonomy terms. I believe you are not using it anyways, as the grouping is enabled: https://i.imgur.com/h5V5iac.png
2. I can check the custom code, but since the FTP was not working, I was not able to. If you want you can upload it via a .zip file.I hope this helps!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 29, 2018 at 3:43 pm #18513You cannot access this content.June 29, 2018 at 4:14 pm #18517Hi,
Thank you! I did not log-in, as I can see the problem within the snippet. Just change it to this, and it will be all right:
I hope this helps!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
June 29, 2018 at 5:10 pm #18521That fixes it, thank you very much. Well worth the price of support. 🙂
Just for my own curiosity (if you don’t mind explaining it a bit further?): I still don’t quite understand why it was giving the error it was showing since all the results were products either way… except I guess maybe category options at the bottom? I would have thought it would show the results up until the ones where it couldn’t get a product object.
June 29, 2018 at 7:46 pm #18528You 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 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 2, 2018 at 3:15 pm #18554Great, thank you very much
July 2, 2018 at 6:49 pm #18555You cannot access this content. Best,
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.