Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #745661

    I need to have a product search field for woocommerce at the beginning of the store category pages.

    How can I do it? How can I work on a category page of the woocommerce store?

    I am using this code because I need a product shop search icon at the beginning of the store, in the mobile version.

    add_theme_support( 'avia_custom_shop_page' );

    Thanks

    #746595

    Hi,

    please I need to have a product search field on top of categories shop pages.

    Thanks

    #747108

    Hi,

    Can you try to post a link to your page? also if you can give us a draft on where you want to place it.

    Best regards,
    Nikko

    #747537

    Hello
    I have the sketch of the web hosted in a temporary host with an alternative url.
    The current website is http://www.gardenbourguignon.com/ I made a few years ago.
    But now we are going to transform it into an online store, and I downloaded enfold shop demo to test it.
    At the moment I am happy and when it is finished, I will replace the old one by the online store. It will be the same domain, not two web pages. It’s just a redesign.
    To put at the beginning of the store a product search field for woocommerce, I used this code:

    Add_theme_support (‘avia_custom_shop_page’);

    To be able to use the visual editor.
    But I need this field of product search for woocommerce also on the category pages.
    In the private field I send a link to the store page and another to a category page.

    Thank you

    #749795

    Hi!

    Thank you for the info.

    You can use the following hook in combination with the is_tax(‘product_cat’) conditional function.

    // http://hookr.io/actions/woocommerce_before_shop_loop
    // https://codex.wordpress.org/Function_Reference/is_tax

    Best regards,
    Ismael

    #750199

    Could this code be?

    if(is_tax('get_search_form')) {
    do_action( 'woocommerce_before_shop_loop', $wc_print_notices, $int );}

    If it is correct … where should I put it?

    #750292

    Hi!

    I’m afraid that’s not correct. The code should look something like this:

    add_action('woocommerce_before_shop_loop', function() {
    	if(is_tax('product_cat')) {
    		get_search_form();
    	}
    });
    

    Add it in the functions.php file.

    Best regards,
    Ismael

    #751821

    Hello,

    thank you very much.

    It works very well

    :)

    #752139

    Hi!

    Great! Let us know if you need anything else. :)

    Cheers!
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Product search field for woocommerce at the beginning of store category pages.’ is closed to new replies.