In order to change the number of products that are being displayed using the Main Query, we need to use a bit of Custom Code.
“Main Query” uses the default WP_Query so, the number of products to be displayed is controlled by WooCommerce.
WooCommerce by default shows only 16 products via Main Query, so you will need to use a bit of custom code to allow a specific number of products while selecting the source as “Main Query”.
Please add the following code in the theme’s functions.php file:
// Change the Number of WooCommerce Products Displayed Per Page add_filter( 'loop_shop_per_page', create_function( '$products', 'return 12;' ), 30 ); //Change 12 to number of products that you want to display
You can change the number of products to show by changing “12” to the number of products you want to display.