• Hello!

    I am stuck trying to edit the text of the Search bar in header “Search for products”, in theme Shopper Pro.

    I could not find the code in header or search folders. Any idea?

    Thanks

    • This topic was modified 6 years, 7 months ago by jsaded.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello jsaded,

    Add below code into your currently active child theme’s functions.php file or you can create custom plugin for it.

    remove_action('shopper_header', 'shopper_custom_product_search', 35);
    
    add_action('shopper_header', 'my_custom_product_search', 35);
    function my_custom_product_search() {
      if ( shopper_is_woocommerce_activated() ) { 
    
        ?>
        <div class="custom-product-search">
          <form role="search" method="get" class="shopper-product-search" action="<?php echo esc_url( home_url( '/' ) ); ?>">
            <div class="nav-left">
              <div class="nav-search-facade" data-value="search-alias=aps"><span class="nav-search-label"><?php _e( 'All', 'shopper' ); ?></span> <i class="fa fa-angle-down"></i></div>      
              <?php
                echo shopper_product_cat_select('indent_sub');
              ?>
            </div>
            <div class="nav-right">
              <button type="submit"><i class="fa fa-search"></i></button>
            </div>
            <div class="nav-fill">
              <input type="hidden" name="post_type" value="product" />
              <input name="s" type="text" value="<?php echo get_search_query(); ?>" placeholder="<?php esc_attr_e( 'Search Here...', 'shopper' ); ?>"/>
            </div>
          </form>
        </div>
        <?php
      }
    }

    Hope this will helps you.

    Thanks.

    Thread Starter jsaded

    (@jsaded)

    Thank you saurabh, but it still doesn’t work. I tried modifing the code but I still couldn’t fixed it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to edit text of Search bar in header?’ is closed to new replies.