• Hello,

    Trying to figure out if I can integrate Woocommerce product search plugin into the menu bar search field? Or if the product search can be added to the menu bar? Thx

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter dsdrk

    (@dsdrk)

    Thanks for your response, Leo!

    I’m referring to using the plugin ‘Woocommerce product search’ in place of the search icon in our menu.

    I implemented the filter in the linked article but prefer the product dropdowns and features that the separate plugin offers. Just curious if I can somehow use the plugin’s search in our menu. Thanks!

    ying

    (@yingscarlett)

    Hi there,

    I found a shortcode provided by the plugin, you can give this PHP snippet a try:

    add_action('generate_menu_bar_items', function(){
    	echo do_shortcode('[woocommerce_product_search]');
    });

    Let me know if this works ??

    Thread Starter dsdrk

    (@dsdrk)

    Thank you! I’m setting up a staging site to test and then will report back. ??

    ying

    (@yingscarlett)

    Hope it works ??

    Thread Starter dsdrk

    (@dsdrk)

    That would just be added to the function.php file, correct? If so, nothing happened when that was added ??

    ying

    (@yingscarlett)

    Even if the shortcode doesn’t work, at least it will show the shortcode text in the menu bar item area.

    Can you try adding the code using code snippet plugin?

    Thread Starter dsdrk

    (@dsdrk)

    It’s not showing the text in the menu bar area. I also installed the code snippet plugin on the staging site, added that code and still nothing shows up.

    Thread Starter dsdrk

    (@dsdrk)

    would there be an issue with ‘menu’ and ‘navigation’? When I add the code from Leo’s link above it says ‘navigation’ and it does change the output of the search bar, it’s just not the same as what the ‘Woocommerce product search’ plugin does. Not sure if that has anything to do with anything :/

    Hi @dsdrk,

    Leo’s suggestion was to change the search function for the entire site but the default search form’s basic functions are intact.

    The code suggestion from the documentation he linked is basically changing the results of the post to only look for products. It doesn’t change anything else.

    Meanwhile, Ying’s suggestion is about adding a new search functionality which is the one specifically from WooCommerce.

    But the issue you seem to be having with it is, the hook doesn’t seem to be working as you’ve mentioned you’re not seeing a text.

    That’s because Ying’s suggestion was meant to display a search bar –
    https://woocommerce.com/document/woocommerce-product-search/shortcodes/woocommerce_product_search/

    If you’re not seeing the search bar, then it’s likely because the hook wasn’t successful. Perhaps it’s because your site is using an older version of GeneratePress that is set to use the old “Floats” layout instead of “Flexbox”. (This setting can be found on Appearance > Customize > General)

    Thread Starter dsdrk

    (@dsdrk)

    Elvin! omg, that was it…the flexbox! Thank you so much!??

    No problem. Let us know if you need further help. ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Woocommerce product search integrated in menu search’ is closed to new replies.