• Resolved teachermark

    (@teachermark)


    Dear all,

    I’ve made a Woocommerce shopping page. Woocommerce generates a standard shopping page and on that page I can drop the searchbar.

    But cause I’m not using the standard shopping page but seperate the pages by categories I cannot add the searchbar to those pages (don’t know how).

    So for instance, I open de category page of beer glasses (only beer glasses) I get an nice view of all those beer glasses I can buy. But on top of that page I want the search bar to search on different beerglas products. But I don’t know how?

    Can someone help me out with this problem?

    Kind regards,

    Mark

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

    (@mihail-barinov)

    Hello,

    There are many ways how you can add plugin search form to your category pages.

    For examle – by using search form widget. But in this case search form will added and on all other pages that supports your widget area.

    Another way – is to customizing your theme category arthive page template.
    So open your theme folder and find woocommerce/archive-product.php file inside it.
    Than add followind code inside

    if ( function_exists( 'aws_get_search_form' ) ) { aws_get_search_form( true ); }

    Thread Starter teachermark

    (@teachermark)

    It seems I can’t find ‘woocommerce/archive-product.php’ when opening the documents with filezilla..

    Widget is filling the sides (which I don’t like). I want the searchbar on top of this page. Using the Mesmerize Theme.

    Plugin Author ILLID

    (@mihail-barinov)

    Looks like I found the solution for you. Please use following code snippet

    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 );
        }
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Thread Starter teachermark

    (@teachermark)

    Dear @mihail-barinov,

    Sorry for my late answer, but damn! This is amazing, many many thanks for this!

    Kind regards,

    Mark

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I add the search bar to woocommerce category pages?’ is closed to new replies.