• Resolved SyCe

    (@syce)


    Hello dear support. I have a question because I’m a bit at a loss. I have integrated the Ajax search on my mobile site via PHP shortcode, but unfortunately customers have noticed that it is not possible to switch to the search results page. Only if you scroll down and click on “Show all”, you get to the search results page. But actually it should also work if you press Enter or not?

    If I integrate the search as a shortcode in WordPress on a single page, it works strangely enough … I have already created a search results page in Elementor but without success :S

    Thanks in advance

    John

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @syce!

    It seems that currently in the mobile version of your theme, the search engine in the header is not the FiboSearch. Please use below code snippet to launch our mobile overlay after clicking the search icon.

    add_action( 'wp_footer', function() { ?>
    	<script type="text/javascript">
    		jQuery(document).ready(function($){
    			$('body').on('click', '.show-search', function(e){
    				if ($(window).width() < 992) {
    					e.preventDefault();
    					$('.dgwt-wcas-enable-mobile-form').click();
    				}
    			});
    		});
    	</script>
    	<style type="text/css">
    		.tbay-search-form {
    			display: none !important;
    		}
    	</style>
    <?php }, 9999 );

    You have two ways to add this code to your theme:

    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the?Code Snippets?plugin and apply this code as a snippet.

    Regards,
    Kris

    Thread Starter SyCe

    (@syce)

    Now it doesn’t work at all :-/ No more action when clicking the button, see https://www.suessigkeiten-shop.com

    Plugin Support Kris

    (@c0nst)

    Hi @syce!

    I improved the code. Now it should be working correctly.

    add_action( 'wp_footer', function() { ?>
    	<script type="text/javascript">
    		jQuery(document).ready(function($){
    			$('body').on('click', '.show-search', function(e){
    				if ($(window).width() < 1199) {
    					e.preventDefault();
    					$('.dgwt-wcas-enable-mobile-form').click();
    				}
    			});
    
    		});
    		jQuery( document ).on( 'fibosearch/hide-mobile-overlay', () => {
    			$('.search-device').removeClass('open');
    		});
    	</script>
    	<style type="text/css">
    		.tbay-search-form {
    			display: none !important;
    		}
    	</style>
    <?php }, 9999 );

    Regards,
    Kris

    Thread Starter SyCe

    (@syce)

    Hey ??

    perfect! This works absolute fine. Thanks so much !!

    Greetings from germany

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mobile Search “Enter” Problem’ is closed to new replies.