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 6 years, 5 months ago.
- AuthorPosts
- March 29, 2017 at 9:58 am #12520
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
March 29, 2017 at 10:05 am #12521Hi,
Just checked, but I’m getting results as I’m typing (on the main site): https://i.imgur.com/cvpIGxO.png
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 29, 2017 at 10:29 am #12522You cannot access this content.March 29, 2017 at 10:32 am #12524You cannot access this content.March 29, 2017 at 10:40 am #12526Hi,
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 :)
March 29, 2017 at 10:42 am #12527You cannot access this content.March 29, 2017 at 11:36 am #12528Hi,
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 :)
March 29, 2017 at 11:43 am #12529magic! 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!
March 29, 2017 at 2:50 pm #12533Hello,
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.March 30, 2017 at 8:54 am #12537Hi,
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 :)
March 30, 2017 at 9:52 am #12539so 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);
}March 30, 2017 at 11:58 am #12541working – thanks!
- AuthorPosts
You must be logged in to reply to this topic.