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

Predictive search not working

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

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #12520
    kensacreativekensacreative
    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 MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Just checked, but I’m getting results as I’m typing (on the main site): http://i.imgur.com/cvpIGxO.png
    I see however one javascript issue in the console, coming from one of the theme javascript files (smoothscroll.js): http://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.

    #12522
    kensacreativekensacreative
    Participant

    You cannot access this content.

    #12524
    kensacreativekensacreative
    Participant

    You cannot access this content.

    #12526
    Ernest MarcinkoErnest 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.

    #12527
    kensacreativekensacreative
    Participant

    You cannot access this content.

    #12528
    Ernest MarcinkoErnest 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.

    #12529
    kensacreativekensacreative
    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
    kensacreativekensacreative
    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);
    }

    #12537
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    You can add it below this line:

    [php]// END ENQUEUE PARENT ACTION[/php]

    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.

    #12539
    kensacreativekensacreative
    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
    kensacreativekensacreative
    Participant

    working – thanks!

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.