Created
April 7, 2016 19:22
-
-
Save SirDarcanos/f24396f0ed2086192ae6205cd976bb4c to your computer and use it in GitHub Desktop.
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_title', 'custom_print_stock', 9 ); | |
function custom_print_stock() { | |
global $product; | |
printf( '<span>Available: %d</span>', esc_html( $product->get_stock_quantity() ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, can you make this to work on single products only and the text that says the WooCommerce default which is this: "[smiley face] Only x left in stock"? Thanks!