Reply 64249 to: Search to include SKU number

Avatar: jjersild
jjersild
Participant
May 15, 2015 at 20:04

I deleted that line as instructed. I have attached the remaining code below. When I search for a product by sku what I get seems to be just posts that have that sku number in vs. the actual product with that sku number.

Here is the remaining code:

<?php
/**
* The template for displaying search forms
*
*/
?>

<?php if(class_exists(‘Woocommerce’)) : ?>

<form action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>” id=”searchform” class=”hide-input” method=”get”>
<div class=”form-horizontal modal-form”>
<div class=”form-group has-border”>
<div class=”col-xs-10″>
<input type=”text” value=”<?php if(get_search_query() == ”){ esc_attr_e(‘Search for products’, ETHEME_DOMAIN);} else { the_search_query(); } ?>” class=”form-control” onblur=”if(this.value==”)this.value='<?php _e(‘Search for products’, ETHEME_DOMAIN); ?>'” onfocus=”if(this.value=='<?php _e(‘Search for products’, ETHEME_DOMAIN); ?>’)this.value=”” name=”s” id=”s” />
</div>
</div>
<div class=”form-group form-button”>
<button type=”submit” class=”btn medium-btn btn-black”><?php esc_attr_e( ‘Search’, ETHEME_DOMAIN ); ?></button>
</div>
</div>
</form>

<?php else: ?>
<?php get_template_part(‘searchform’); ?>
<?php endif ?>

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.