Created
December 15, 2017 11:35
-
-
Save ellegaarddk/33b72743835dc85ebc769e5c76daeb69 to your computer and use it in GitHub Desktop.
Tilføjer 'Udsolgt label til WooCommerce
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
// Adds 'Udsolgt' label to produkts out of stock | |
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">Udsolgt</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment