Disable Ajax load

This topic contains 11 replies, has 2 voices, and was last updated by Alexander Vinnik Alexander Vinnik 8 years, 2 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #7453
    Alexander Vinnik
    Alexander Vinnik
    Participant

    Hello

    I need:
    – when user click on “try this” keyword it redirects right to search results page;
    – when user enters some keyword in search filed and click “Enter” or on “Search icon” it opens a search results page;

    How to do this?;

    #7457
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    2. You can enable that on the General Options -> Behavior panel: https://i.imgur.com/rUaziJ7.png

    1. There is no option to redirect the “try this” keywords to the results page, however you can use this code snippet, if you have the option above enabled:

    <script>
    var _scope = ASP.getScope();
    _scope(function($) {
    	$("p.asp-try a").click(function(){
    		setTimeout(function(){
    			var e = $.Event( "keyup", { which: 13 } );
    			$("input.orig").trigger(e);
    		}, 400);
    	});
    });
    </script>

    You can put this in your active themes folder, into the footer.php file, just before the closing body tag.

    Best,
    Ernest Marcinko

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


    #7488
    Alexander Vinnik
    Alexander Vinnik
    Participant

    Thanks,
    How to make it work on mobile version as it works only on desktop version?

    #7503
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Maybe try to change the script to:

    <script>
    var _scope = ASP.getScope();
    _scope(function($) {
        $("p.asp-try a").click(function(){
            setTimeout(function(){
                $("div.promagnifier").click();
            }, 400);
        });
    });
    </script>
    Best,
    Ernest Marcinko

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


    #7516
    Alexander Vinnik
    Alexander Vinnik
    Participant

    It helped, thanks!
    Another question, how to change the font size of “try this” keywords?

    #7518
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You can try a custom CSS code for that, something like:

    
    p.asp-try a {
        font-size: 18px !important;
    }
    

    That should do the trick.

    Best,
    Ernest Marcinko

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


    #7519
    Alexander Vinnik
    Alexander Vinnik
    Participant

    Thank you for fast reply!

    #7527
    Alexander Vinnik
    Alexander Vinnik
    Participant

    Hi

    I have a few issues:

    1. The script you provided for mobile version:

    
    &lt;script&gt;
    var _scope = ASP.getScope();
    _scope(function($) {
        $("p.asp-try a").click(function(){
            setTimeout(function(){
                $("div.promagnifier").click();
            }, 400);
        });
    });
    &lt;/script&gt;
    

    does not work properly, when I save my footer.php file and load my webpage it works only for several searches after that it does not work as it should – it does not redirects to search results but make an ajax search instead;

    2. Also I need this search results to open in a new page;

    #7528
    Alexander Vinnik
    Alexander Vinnik
    Participant

    BTW actually this one:
    “2. Also I need this search results to open in a new page;”

    is not needed for now, just need to resolve the 1st issue

    #7538
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    It’s already a customization workaround, unfortunately I cannot guarantee it’s going to work.

    You can try one more thing, maybe lowering the timeout value down to 50, and combining with the previous solution.

    First possibility:

    <script>
    var _scope = ASP.getScope();
    _scope(function($) {
        $("p.asp-try a").click(function(){
            setTimeout(function(){
                $("div.promagnifier").click();
                var e = $.Event( "keyup", { which: 13 } );
                $("input.orig").trigger(e);
            }, 50);
        });
    });
    </script>

    Second possibility:

    <script>
    var _scope = ASP.getScope();
    _scope(function($) {
        $("p.asp-try a").click(function(){
            setTimeout(function(){
                $("div.promagnifier").click();
            }, 50);
        });
    });
    </script>

    One of them might work correctly, I’m betting on the first one.

    Best,
    Ernest Marcinko

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


    #7544
    Alexander Vinnik
    Alexander Vinnik
    Participant

    Unfortunately it does not help:(

    #7545
    Alexander Vinnik
    Alexander Vinnik
    Participant

    if there is no other solutions maybe as an alternate to make this:

    only for mobile version (if possible?): when you click on try this keyword it just fills the search input with this keyword and then I can click on search button and it opens a search results

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

You must be logged in to reply to this topic.