Created
November 8, 2012 11:25
-
-
Save jameskoster/4038260 to your computer and use it in GitHub Desktop.
WooCommerce 'out of stock' on product archives
This file contains 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
// The following goes in functions.php | |
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_stock', 10); | |
function woocommerce_template_loop_stock() { | |
global $product; | |
if ( ! $product->managing_stock() && ! $product->is_in_stock() ) | |
echo '<p class="stock out-of-stock">out-of-stock</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which file does this go in? I've added the code to the functions.php file for the plugin-in and didn't see any changes.