In this tutorial, my goal is to show the “stock quantity or status” under each product in the shop, category and archive pages.

This follows exactly the same settings as the stock display of the single product page. Go to /wp-admin/admin.php?page=wc-settings&tab=products&section=inventory to manage “Stock display format”. Enjoy!

WooCommerce: Add Stock Quantity on Shop Page

PHP Snippet: Display Stock Quantity/Status @ WooCommerce Shop Page

/**
 * @snippet       Stock Quantity @ WooCommerce Shop / Cat / Archive Pages
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.7
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_action( 'woocommerce_after_shop_loop_item', 'bbloomer_show_stock_shop', 10 );
 
function bbloomer_show_stock_shop() {
	global $product;
	echo wc_get_stock_html( $product );
}
Share:

Leave a Reply