Menubar › searchbox menubar for woocommerce products only
-
AuthorPost
-
Rick
GuestHi there,
Is it possible to edit the searchfield so they only see woocommerce product results?
andrea
Plugin AuthorHi Rick,
If WooCommerce has that feature, i.e. a search field to look for products only, we can reproduce it in the Menubar search field.
Rick Prins
GuestHi andrea,
When I use your searchbox the output looks like: http://www.yoursite.com/?s=keyword
when I use the woocommerce product searchbox the output is: http://www.yoursite.com/?s=keyword&post_type=product
So maybe it’s possible to add a suffix in your searchscript?
Maybe you can tell me where I have to put the suffix?
Hope to hear from you soon!
Kind regards,
Rick
andrea
Plugin AuthorHi Rick,
If you are using the Superfish template, open the file:
wp-content/plugins/menubar/templates/Superfish/wpm3.php
locate the lines:
%submit </form></li> ';and, right before them, insert the line:
<input type="hidden" name="post_type" value="product" />If you are using the Suckerfish_45 template instead, you have to modify, in the same way, this file:
wp-content/plugins/menubar/templates/Suckerfish_45/wpm3.php
Please let me know if that works for you!
Rick Prins
GuestWorks like a charm!
Thanks Andrea!
-
AuthorPost