Seach bar is not working in woocommerce for products? ( just modify the code on search-form.php in wordpress)

Open search-form.php file in woocommerce template 

There are the  words in search scope that is 'product' 

and,  you just have to change it to 'posts'  see example below-
<?php global $woo_options; ?>
<div class="search_main">
<form method="get" class="searchform" action="<?php echo home_url( '/' ); ?>" >
<input type="text" class="field s" name="s" value="<?php _e( 'Search', 'woothemes' ); ?>" onfocus="if (this.value == '<?php _e( 'Search', 'woothemes' ); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search', 'woothemes' ); ?>';}" />

        <?php if ( isset( $woo_options['woo_header_search_scope'] ) && $woo_options['woo_header_search_scope'] == 'posts' && is_woocommerce_activated() ) { echo '<input type="hidden" name="post_type" value="post" />'; } ?>
        
<button type="submit" class="icon-search submit" name="submit" value="Search"></button>
    
</form>    
    <div class="fix"></div>
</div>

2 comments:

  1. Php has extensive plugins, tools and technologies that make it so popular, it can easily be integrated with multiple libraries and extensions.
    hire ecommerce developer

    ReplyDelete
  2. The greatest impediment on the path of the Android app development is the ability to find the best way and tools, for the Android app development.
    mobile app development services

    ReplyDelete