searchbox menubar for woocommerce products only

Home Forums Menubar Forum searchbox menubar for woocommerce products only

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6527 Reply
    Rick
    Guest

    Hi there,

    Is it possible to edit the searchfield so they only see woocommerce product results?

    #6528 Reply
    andrea
    Keymaster

    Hi 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.

    #6529 Reply
    Rick Prins
    Guest

    Hi 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

    #6530 Reply
    andrea
    Keymaster

    Hi 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!

    #6532 Reply
    Rick Prins
    Guest

    Works like a charm!

    Thanks Andrea!

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: searchbox menubar for woocommerce products only
Your information: