Last active
June 30, 2016 17:29
-
-
Save lehelmatyus/2a3003a96025e613317f62d0db259630 to your computer and use it in GitHub Desktop.
Modify WooCommerce In stock text
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
<?php | |
function inastheme_get_availability( $availability, $_product ) { | |
global $product; | |
$stock = $product->get_total_stock(); | |
if ( $_product->is_in_stock() ) $availability['availability'] = __('Limitierte Edition' . $stock . ' erhältlich', 'woocommerce'); | |
if ( !$_product->is_in_stock() ) $availability['availability'] = __('SOLD OUT', 'woocommerce'); | |
return $availability; | |
} | |
add_filter( 'woocommerce_get_availability', 'inastheme_get_availability', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment