Replace the SuperSide Me Search Form with WooCommerce Search

Although WooCommerce provides a widget for their search form, the SuperSide Me widget area is added to the end of the navigation panel. If you want the product search form to replace the default SuperSide Me search form, you can use this code example to swap it out easily:

<?php
add_filter( 'supersideme_search_output', 'prefix_use_woo_search' );
/**
* Replace the default SuperSide Me search form with the WooCommerce product search.
* @param $search_form string
*
* @return string
*/
function prefix_use_woo_search( $search_form ) {
if ( function_exists( 'get_product_search_form' ) ) {
$search_form = '<div class="search-me">';
$search_form .= get_product_search_form( false );
$search_form .= '</div>';
}
return $search_form;
}
view raw functions.php hosted with ❤ by GitHub
Return to SuperSide Me
Bars Code Check chevron-down chevron-left chevron-right chevron-up Envelope Laptop Search Times Facebook GitHub Google Plus Instagram LinkedIn Pinterest Twitter WordPress Logo Wordpress Simple