• Resolved estudiobla

    (@estudiobla)


    I’ve added the search bar to the top of the product category pages, is it possible to also add it on the main shop? right under Home / Shop.
    The template es quite limited and Elementor doesn’t allow editing the shop page.

    This is the code I’m using right now:

    add_action( 'woocommerce_archive_description', 'my_woocommerce_before_shop_loop' );
    function my_woocommerce_before_shop_loop() {
    if ( is_tax( 'product_cat' ) && function_exists( 'aws_get_search_form' ) ) {
    aws_get_search_form( true );
    }
    }

    Thank you!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Can you please tell me the name of the WordPress theme that you are currently using?

    Regards

    Thread Starter estudiobla

    (@estudiobla)

    Yes, Astra free. Thank you!

    Plugin Author ILLID

    (@mihail-barinov)

    Please try this code snippet instead you previous one:

    add_action( 'woocommerce_archive_description', 'my_woocommerce_before_shop_loop' );
    function my_woocommerce_before_shop_loop() {
        if ( ( is_tax( 'product_cat' ) || is_shop() ) && function_exists( 'aws_get_search_form' ) ) {
            aws_get_search_form( true );
        }
    }
    Thread Starter estudiobla

    (@estudiobla)

    Worked beautifully, thank yo so much!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding search box to main shop’ is closed to new replies.