How to add paging on the search.php page in Woocommerce

Asked

Viewed 42 times

0

Paging is not working in search.php on the site I am developing. When I ask to show all the products, it shows the pagination, but when I do a search where results are generated for various pages, it only returns me the first page and does not allow me to change to the next page, as shown on the page of all products.

search.php: </H2> -->

    woocommerce_product_loop_start();
    woocommerce_product_subcategories();

    while (have_posts()):
        the_post();
        wc_get_template_part('content', 'product');
    endwhile; // end of the loop. 
    woocommerce_product_loop_end();
    /**
     * woocommerce_after_shop_loop hook.
     *
     * @hooked woocommerce_pagination - 10
     */
    do_action( 'woocommerce_after_shop_loop' );
    <?php 

elseif (!woocommerce_product_subcategories(array(
        'before' => woocommerce_product_loop_start(false),
        'after' => woocommerce_product_loop_end(false)
    ))):
    wc_get_template('loop/no-products-found.php');

endif;
?> </div><!-- /pagina-loja__dir --></div><!-- /row --></div><!-- /container --></div><!-- /pagina-loja --> <?php
get_footer('shop');
?>

  • Give more details about the problem

  • 1

    Changed the topic, I hope I’ve improved

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.