url parameter is getting changed from ?s= to ?phrase= while implementing the plu

Home Forums Product Support Forums Ajax Search Pro for WordPress Support url parameter is getting changed from ?s= to ?phrase= while implementing the plu

This topic contains 22 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #31996
    jsamal29
    jsamal29
    Participant

    Hi Team,

    We have implemented the AjaxSearchPro plugin in the below page of our website.
    https://dev-www.motor.com/testpage/
    After entering a text (e:g; seyfert) as input to the Search box when we press Enter. Then it is taking us to the page https://dev-www.motor.com/testpage/?phrase=seyfert#

    But actually as the WordPress default search works on Query string as “?s=” instead of “?phrase=”.

    For example below Url uses default wordpress query string as “?s=” and it provides valid result.
    https://dev-www.motor.com/?s=seyfert

    Because of this roadblock we are not able to see the result delivered by plugin and thus we are stuck at further items such as result grouping etc.

    Please let us know what can be done in order to fix the issue.

    thanks
    Jyotiranjan

    #31997
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you for the details! Unfortunately the URL does not seem to work, I am getting the a timeout error: https://i.imgur.com/SSa0op9.png

    The issue you described happens, when there is a fatal javascript error on the page caused by something, and the plugin can not properly initialize. I would try to look on the given URL on the javscript error console, but it does not open unfortunately.

    Best,
    Ernest Marcinko

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


    #32056
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    The url https://dev-www.motor.com is actually a dev environment and thus cannot be accessible by internet.
    I checked the console for any javascript conflict, I could not find any fatal javascript error. However I did found a javascript error for one of the file related to another plugin called Optinmonster (see attached screenshot)
    Can you suggest something to check if the plugin works fine in any given page?

    Thanks
    Jyotiranjan

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

    That is actually a fatal error right there, and very likely the cause of the issue. Try turning off that plugin temporarily, it should resolve the problem alltogether. If that plugin as some sort of a javascript minification feature, that might be the misconfigured component causing the problem.

    Best,
    Ernest Marcinko

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


    #32080
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    I tried both re-installing the Ajaxpro plugin and also disabling the OptinMonster plugin. Both yielded 0no result (see attached screenshot) https://imgur.com/a/sLXeQON

    If I can provide screenshare then is there any way where you can guide on the same.

    Thanks in advance
    Jyotiranjan

    #32081
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Well, without access this is going to be very hard. Unfortunately screenshare is not an option for us.

    Try the following:
    – Make sure there is no duplicate of jQuery loaded. If you are using a customized theme, we have seen custom jQuery loaded to the site footer. This causes the previously loaded scripts to unload. Removing the duplication helps.
    – Make sure that the wp_footer() call is present in the footer.php file in the theme directory. Custom themes or child themes tend to miss that and the scripts can not load.
    – You can also try this option. If it helps, then the wp_footer() call is probably missing from the theme.

    Best,
    Ernest Marcinko

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


    #32091
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    We tried with the above suggestions on a) check for duplicate jquery and b)presence of wp_footer() in footer.php.

    However we found out that the below files are not being loaded on the pages, which is resulting in non-initialization of the ajax instance in the page where the Search Box is placed.

    <script type=’text/javascript’ src=’http://<server name>/wp-content/plugins/ajax-search-pro/js/min/jquery.ajaxsearchpro-sb.min.js?ver=IDdZ0m’ id=’wd-asp-ajaxsearchpro-js’></script>

    <script type=’text/javascript’ id=’wd-asp-ajaxsearchpro-js-extra’>
    /* <![CDATA[ */
    var ASP = {“ajaxurl”:”ht ……”}

    We tried with multiple options available in “Compatibility Settings” section, but didnt help. Çan you guide us on what circumstances the above files can be ignored to be called?

    Thanks
    Jyotiranjan

    #32100
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It can either happen if you have the selective asset loading enabled. If not that, then either the wp_header() of the wp_footer() calls are completely missing from the theme header and footer files. Or there is another plugin or a custom code dequeueing the assets.

    Best,
    Ernest Marcinko

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


    #32108
    jsamal29
    jsamal29
    Participant

    Hi,

    In the location wp-content / themes / <themename>/, I checked 3 files i:e; functions.php, header.php and footer.php.

    I could find wp_footer() in footer.php, but I could not find wp_header() in header.php. Could this be the reason and how to fix this?

    Thanks
    Jyotiranjan

    #32109
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You may have to consult with the theme developer about that. wp_head() could be added there via inclusions as well, but he will definitely know if it’s there and if not, then what to do.

    Best,
    Ernest Marcinko

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


    #32110
    jsamal29
    jsamal29
    Participant

    Hi,

    Also my colleague found out that there are multiple Exits that could result in non initialization of the plugin funtionality. Can you clarify on this as well?

    Thanks
    Jyotiranjan

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

    Can you please explain what the problem is with that code? It is only the handler of the selective asset loading, it has no effect when that feature is disabled. Let me know if you find anything problematic there.

    Best,
    Ernest Marcinko

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


    #32118
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    One other thing popped into my mind, make sure that the wp-hooks script is not dequeued. It should be enqueued automatically, unless something else is forcefully dequeueing it. Use this to force the enqueue:

    wp_enqueue_script( 'wp-hooks' );

    Best,
    Ernest Marcinko

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


    #32120
    jsamal29
    jsamal29
    Participant

    Hi Ernest,

    Can you provide some guidance on how and in which file I need to add the code to force the enqueue – wp_enqueue_script( ‘wp-hooks’ );

    Thanks
    Jyotiranjan

    #32123
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure 🙂 Try the functions.php file in your theme directory, that should work.

    You can check if it is included, if you try searching in the frontend source code for this:

    wp-includes/js/dist/hooks.min.js

    If the code work, then this file should be present somewhere.

    Best,
    Ernest Marcinko

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


Viewing 15 posts - 1 through 15 (of 23 total)

You must be logged in to reply to this topic.