If you don’t have much product and you want to display all products, then this snippet will work for you. This snippet will change the number of products shown per page on the shop page.

If you have 20 or fewer products, then you don’t need to display pagination instead of display all products on the shop page. You just need to change the count of products, and you are ready.
Code: Change the number of products displayed per page @ shop page
/**
* @snippet WooCommerce: Change the number of products displayed per page @ shop page
* @author Sandesh Jangam
* @donate $7 https://www.paypal.me/SandeshJangam/7
*/
add_filter( 'loop_shop_per_page', 'ts_restrict_product_count_shop_per_page', 99 );
function ts_restrict_product_count_shop_per_page( $products_count ) {
// Set your expected product count here.
$products_count = 12;
// Return the product count.
return $products_count;
}