Created
November 2, 2018 00:31
-
-
Save jamesgol/a7bb7dfaee3d565822de189c210cd484 to your computer and use it in GitHub Desktop.
Add quantity to WooCommerce shop loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_after_shop_loop_item', 'jmg_woo_add_stock' ); | |
function jmg_woo_add_stock() { | |
global $product; | |
if ( $product->managing_stock() ) { | |
// Only on products with managed stock | |
echo wc_get_stock_html( $product ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment