How to WooCommerce display in-stock and out-stock quantity in shop page?

The wordpress website in WooCommerce shop page in show in-stock and out-stock quantity or status You need to display in-stock and out-stock quantity status in Woocommerce website's each product in the shop, category and archive pages.

Stock quantity show in woocommerce shop category and archive pages

Always use child theme any wordpress website and copy below code and add this code in your functions.php and in woocommerce shop page.
Use this below in-stock and out-stock quantity shortcode for shop, category and archive pages-

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 );
}

Post a Comment

0 Comments