result page

This topic contains 4 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 months, 4 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #39466
    YUANFAN
    YUANFAN
    Participant

    How to make the result page appear in the iframe instead of jumping?
    I can’t find the code location.

    • This topic was modified 4 months, 1 week ago by YUANFAN YUANFAN.
    #39479
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I am not sure if this is possible at all. The form had to be submitted to the iframe, but the iframe source also has to be the original page.
    I don’t think this is easily possible without maybe editing the core plugin files.

    Best,
    Ernest Marcinko

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


    #39489
    YUANFAN
    YUANFAN
    Participant

    I uploaded a picture
    My iframe is just below the search and I want the result page to appear in the iframe

    The settings of the plugin Results Behaviour cannot be implemented, there is only an option to open a new window.

    Because I’m not good at coding and don’t know where to start.

    Attachments:
    You must be logged in to view attached files.
    #39512
    YUANFAN
    YUANFAN
    Participant

    How to code the way to open the jump result page?
    I don’t see _blank, where else can I modify it?

    #39513
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Please note that custom coding is not actually part of our support. I will try to answer your questions, but I can’t promise anything regarding custom code.

    The redirection to the results page (when assigned to a new window) is handled by a function. Maybe if you try to override that, it may actually work:

    add_action('wp_footer', 'asp_add_footer_script_2', 9999);
    function asp_add_footer_script_2() {
    	?>
    	<script>
    	(function($){
    		WPD.ajaxsearchpro.helpers.openInNewTab = function(url) {
                      Object.assign(document.createElement('a'), { target: 'iframe1', href: url}).click();
                    }
    	}(WPD.dom))
    	</script>
    	<?php
    }

    For this you also have to change the redirection to a new tab: https://i.imgur.com/KrUwaGP.png

    However this may not work at all.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.