Skip to content

Instantly share code, notes, and snippets.

@lkoudal
Forked from jameskoster/gist:4038260
Created October 1, 2013 23:05
Show Gist options
  • Save lkoudal/6786605 to your computer and use it in GitHub Desktop.
Save lkoudal/6786605 to your computer and use it in GitHub Desktop.
// 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