• Resolved mayank29gupta

    (@mayank29gupta)


    I am using eightstore-lite theme for my woocommerce website. The search icon appears on top right hand side. How may I replace the existing search with Smart Woocommerce Search? I talked to the theme developer and he told me to edit search serchforum-header template in theme. Below is the code from it. Kindly tell me what changes are required to make.

    <?php
    /**
      *
     * @package Accesspress Store
     */
    ?>
    <form method="get" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
    	<input type="text" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" class="search-field" placeholder="<?php __('Search...','eightstore-lite') ?>" />
    	<div class="search-in-select">
    		<span class="search-in"><?php _e('in','eightstore-lite') ?></span>
    		<select name="post_type" class="select-search-type">
    			<option value=""><?php echo __('All','eightstore-lite');?></option>
    			<option value="product"><?php echo __('Product','eightstore-lite');?></option>
    			<option value="post"><?php echo __('Post','eightstore-lite');?></option>
    		</select>
    	</div>
    	<button type="submit" class="searchsubmit"><i class="fa fa-search"></i></button>
    </form>

    And this is the code from header.php file.

    <div class="right-links">
    						<!-- if enabled from customizer -->
    						<?php if(get_theme_mod('hide_header_search')!='1'){ ?>
    						<div class="header-search">
    							<a href="javascript:void(0)"><i class="fa fa-search"></i></a>
    							<div class="search-box">
    								<div class="close"> &times; </div>
    								<?php get_template_part('searchform-header'); ?>
    							</div>
    						</div> <!--  search-form-->
    						<?php } ?>
    • This topic was modified 6 years, 2 months ago by mayank29gupta.

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author YummyWP

    (@yummy-wp)

    Hi there,

    You should replace <?php get_template_part(‘searchform-header’); ?> line with
    <?php echo do_shortcode(‘[smart_search id=”1″]’); ?> in the header.php file, but you should check search id in the smart search settings and replace it in the code if needed.
    By the way you might need some styling.

    Best regards
    Stanislav

    Thread Starter mayank29gupta

    (@mayank29gupta)

    Sorry but it didn’t work. On changing the code I got this error

    Parse error: syntax error, unexpected ‘id’ (T_STRING), expecting ‘]

    Plugin Author YummyWP

    (@yummy-wp)

    Probably editor replaced quotes.
    Please try this
    <?php echo do_shortcode('[smart_search id="1"]'); ?>

    Plugin Author YummyWP

    (@yummy-wp)

    Closed due to inactivity.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Edit Template to Show Smart Woocommerce Search’ is closed to new replies.