Home › Forums › Support › GeneratePress theme compatibility/handling of WooCommerce Product Search plugin
- This topic has 1 reply, 2 voices, and was last updated 4 years, 1 month ago by
David.
-
AuthorPosts
-
February 20, 2022 at 11:37 pm #2127031
Peter
Re: GeneratePress theme compatibility/handling of WooCommerce Product Search plugin
There’s no official instructions specifically on how to set up WooCommerce Product Search plugin within Generate Press.
I’m not sure if WooCommerce Product Search plugin is compatible with Generate Press theme out of the box. Can you confirm?I’m currently using this official GP snippet:
add_filter( 'generate_navigation_search_output', function() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" /> <input type="hidden" name="post_type" value="product" /> </form>', esc_url( home_url( '/' ) ), esc_attr( get_search_query() ), esc_attr_x( 'Search', 'label', 'generatepress' ) ); } );And also, I’m using this GP snippet for the placeholder text:
add_filter( 'generate_navigation_search_output', function() { printf( '<form method="get" class="search-form navigation-search" action="%1$s"> <input type="search" placeholder="Enter your search" class="search-field" value="%2$s" name="s" title="%3$s" /> </form>', esc_url( home_url( '/' ) ), esc_attr( get_search_query() ), esc_attr_x( 'Search', 'label', 'generatepress' ) ); } );Is that correct?
Is it all that’s needed?
Looking at my WooCommerce website (provided in the private notes), can you confirm if the WooCommerce Product Search plugin functionality is properly integrating with GP Theme?
Why are the search results so slow to come up?February 21, 2022 at 4:15 am #2127291David
StaffCustomer SupportHi there,
the two Snippets you have aren’t related to the Woocommerce Product Search plugin.
They are simply telling the GP Navigation Search to only search for the Product Post type.To add Woocommerce Product Search you either need to add their widget or their shortcode.
If you want ti in the Navigation bar then you can:1. Add a new Hook Element in Appearance > Elements.
https://docs.generatepress.com/article/hooks-element-overview/2. Add to the hook content the woo shortcode:
[woocommerce_product_search]
3. Set the Hook togenerate_menu_bar_items
4. Check Execute Shortcodes
5. Set the Display Rules to Entire SiteThen disable the Navigation Search in the Customizer.
-
AuthorPosts
- You must be logged in to reply to this topic.