display 100 products per page on product category page [closed]

I need to display 100 product on product category page at once, if there are 100 available .

What should happen if you dont have 100 Products?
Or do you want to show just all products?

Anyway, you can try changing the query parameters (specifically here the posts_per_page parameter) on product category pages only.

You can use a WooCommerce hook to do this.

add_action( 'woocommerce_product_query', 'my_custom_query_code' );
function my_custom_query_code( $query ){
    // only on product category pages, no other archives
    if ( is_product_category() ) {

        $limit="100"; // the number of products

        // set the new "posts_per_page" parameter
        $query->set( 'posts_per_page', $limit );
    }
}

Leave a Comment