Skip to content

Instantly share code, notes, and snippets.

@jamesgol
Created November 2, 2018 00:31
Show Gist options
  • Save jamesgol/a7bb7dfaee3d565822de189c210cd484 to your computer and use it in GitHub Desktop.
Save jamesgol/a7bb7dfaee3d565822de189c210cd484 to your computer and use it in GitHub Desktop.
Add quantity to WooCommerce shop loop
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