Support » Plugin: YITH WooCommerce Ajax Search » Replace Storefront Search

  • Hey there,
    How and where shall I place the code <?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?> to replace the default search function from Storefront theme?

    It would be great to do this with the Snippet Plugin.

    Kind regards!

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter d0cj0hn

    (@d0cj0hn)

    Hello, can someone give me a help on doing this, please?

    Plugin Author YITHEMES

    (@yithemes)

    Hello,
    if you want replace the product search inside the storefront header,
    you can use this snippet

    
    if( defined('YITH_WCAS_VERSION')){
    	remove_action( 'storefront_header', 'storefront_product_search', 40 );
    	
    	add_action( 'storefront_header', 'ywcas_product_search', 40 );
    	function ywcas_product_search(){
    		?>
    		<div class="site-search">
    			<?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?>
    		</div>
    		<?php
    	}
    }

    Put it inside the file functions.php of storefront.

    Thread Starter d0cj0hn

    (@d0cj0hn)

    Hello, thank you very much for the reply.
    I tried this snippet, but it still uses the custom search function.

    Just testing another search plugin, but it would be great to get yours working.

    Any idea what could be wrong?

    Kind regards.

    Thread Starter d0cj0hn

    (@d0cj0hn)

    Hello, unfortunately it was not possible to replace the header search with your plugin. Can you please help me with this issue?

    Plugin Author YITHEMES

    (@yithemes)

    Hello,

    The code has been tested and it works. Did you add the code to the functions.php file located on the Storefront directory?

    Thread Starter d0cj0hn

    (@d0cj0hn)

    Hello, yes. I added the code via snippet plugin to the functions.php, but unfortunately I had no luck with it.

    For now I had to change the plugin to get a functional search.

    Anyway, thank you very much for the support until here.

    Kind regards!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Replace Storefront Search’ is closed to new replies.