Skip to content

Instantly share code, notes, and snippets.

@yourdesigncoza
Created June 9, 2013 14:42
Show Gist options
  • Save yourdesigncoza/5743783 to your computer and use it in GitHub Desktop.
Save yourdesigncoza/5743783 to your computer and use it in GitHub Desktop.
Out of stock custom text after title in archive pages
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_out_stock', 10);
function woocommerce_template_loop_out_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