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

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #18504
    Chris Patrick
    Chris Patrick
    Participant

    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. ><

    #18505
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    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 :)


    #18513
    Chris Patrick
    Chris Patrick
    Participant
    You cannot access this content.
    #18517
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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 :)


    #18521
    Chris Patrick
    Chris Patrick
    Participant

    That 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.

    #18528
    Ernest Marcinko
    Ernest 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 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #18554
    Chris Patrick
    Chris Patrick
    Participant

    Great, thank you very much

    #18555
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.