Last active
March 23, 2021 17:50
-
-
Save rynaldos-zz/099dbfb53b6a5e464cd4f5d6bbb77bca to your computer and use it in GitHub Desktop.
[WooCommerce] Display 'SOLD' label on product archive pages (out of stock items)
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', '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">SOLD</p>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment