I need to remove pagination from shop-collection page and want to show all product in one page. How its possible by woocommerce plugin ? I'm using latest wordpress and latest woocommerce plugin
Thanks
You can use woocommerce_product_query hook:
add_action( 'woocommerce_product_query', 'all_products_query' );
function all_products_query( $q ){
$q->set( 'posts_per_page', -1 );
}
This hook adds your code at the bottom of the function product_query.
From the code:
/** * Query the products, applying sorting/ordering etc. This applies to the main wordpress loop. * * @param mixed $q */
public function product_query( $q )
Query the products, applying sorting/ordering etc. This applies to the main wordpress loop.