[Support request] WooCommerce Search bar in Page Header

Home Forums Support [Support request] WooCommerce Search bar in Page Header

Home Forums Support WooCommerce Search bar in Page Header

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #853326
    Lukas

    Hello,

    is it a chance to add WooCommerce search form in Elements > Page Header? Like here?http://prntscr.com/n4mx5d

    I had tried add this code to header:

    <?php get_product_search_form(); ?>

    but didn’t work. I also made this custom hook:

    add_shortcode( 'woosearch', 'get_product_search_form' );

    and use shortcode [woosearch] in page header, but it also didn’t work.

    Thank you.

    GP Premium 1.7.8
    #853397
    David
    Staff
    Customer Support

    Hi there,

    Header Elements don’t accept PHP, and trying to turn the default woo search form to a shortcode is a nightmare, probably because Woo add it to their premium extensions.

    You could use the Widget Shortcodes plugin to generate a shortcode.
    Or maybe one of the other search plugins, like this one with Ajax Search:

    https://wordpress.org/plugins/advanced-woo-search/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.