Predictive search not working

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Predictive search not working

This topic contains 11 replies, has 2 voices, and was last updated by kensacreative kensacreative 5 years, 2 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #12520
    kensacreative
    kensacreative
    Participant

    Hello,

    Something has happened to our search bar. The predictive search no longer works.

    I am currently doing some checks and updates, so i cloned the main website (http://skillssearch.marchesgrowthhub.co.uk/) to: http://skilltest1.wpengine.com/

    Can you please look into this, as the client looking for answers asap.

    thx

    Sud

    #12521
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Just checked, but I’m getting results as I’m typing (on the main site): https://i.imgur.com/cvpIGxO.png
    I see however one javascript issue in the console, coming from one of the theme javascript files (smoothscroll.js): https://i.imgur.com/96K0qvf.png
    That can cause blocking javascript errors, and possibly the failure of the search script as well, it’s definitely worth investigating.

    Best,
    Ernest Marcinko

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


    #12522
    kensacreative
    kensacreative
    Participant
    You cannot access this content.
    #12524
    kensacreative
    kensacreative
    Participant
    You cannot access this content.
    #12526
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I can’t access the site, it requires .htpassword login.

    From the error message on the second screenshot, there it appears that you either try to view the site on “http” protocol, but the main ajax URL is set to ‘https’ (or vice versa), which causes the problem, as it qualifies as CORS request.

    I recommend changing all base URLs to either use the “http” or the “https” version (on wordpress back-end), or allow cross origin access via .htaccess. Also, you have a .htpassword protection, which can also block the ajax requests, but I don’t think that is the problem here.

    Best,
    Ernest Marcinko

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


    #12527
    kensacreative
    kensacreative
    Participant
    You cannot access this content.
    #12528
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Please read my previous response, the problem is exactly what I expected. WordPress returns the incorrect ajax URL (with ‘https’), because it thinks that the current site is using SSL. The plugin uses the WordPress code admin_url() function to parse it. Make sure to correct the site URL and that there is no rule forcing to redirect to the ‘https’ version in the .htaccess file.

    As a bypass solution you can try this code:

    This is however only a bypass, I would still recommend investigating why the site returns an incorrect ajax url.

    Best,
    Ernest Marcinko

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


    #12529
    kensacreative
    kensacreative
    Participant

    magic! It works when we add “https://” before the domain

    It works on this URL now: https://skillstemp1.wpengine.com/

    Thanks for you help and support!

    #12533
    kensacreative
    kensacreative
    Participant

    Hello,

    Just so we’re on the same.

    I am sending you a screenshot of the where i need add the following code, please so I dont mess this up

    add_filter(‘admin_url’, ‘asp_change_admin_url’, 99999, 1);
    function asp_change_admin_url($url) {
    return str_replace(‘https:’, ‘http:’, $url);
    }

    Attachments:
    You must be logged in to view attached files.
    #12537
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    You can add it below this line:

    // END ENQUEUE PARENT ACTION

    But I highly recommend using an FTP editor, and using a back-up copy of everything before editing the files. If anything goes wrong, you can then restore it.

    Best,
    Ernest Marcinko

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


    #12539
    kensacreative
    kensacreative
    Participant

    so like this right? Sorry my PHP isn’t great

    // END ENQUEUE PARENT ACTION

    add_filter(‘admin_url’, ‘asp_change_admin_url’, 99999, 1);
    function asp_change_admin_url($url) {
    return str_replace(‘https:’, ‘http:’, $url);
    }

    #12541
    kensacreative
    kensacreative
    Participant

    working – thanks!

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

You must be logged in to reply to this topic.