change Out of stock label – Function.php code doesn’t work 4 me
-
Hi,
I’m going crazy with ‘Out of stock’ label on sold out product.
i would like to change them to ‘sold out’. But no way:I tried with:
add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2);
function wcs_custom_get_availability( $availability, $_product ) {
// Change Out of Stock Text
if ( ! $_product->is_in_stock() ) {
$availability[‘availability’] = __(‘Sold Out’, ‘woocommerce’);
}
return $availability;
}and other similar codes.
The origin of the issue it’s probably owned to the Theme (Kloe theme).
Having a look to its PO language file I can see that the original name in the original source text is ‘Out of stock’. Probably the theme overcome Woocommerce. So probably in Function.php I have to use different code to target Kloe theme. I’m selling woman bags: Out of stock it’s not ok..
Thanks a lot.PS please, why you don’t introduce a setting page to change these labels. Could be greta.
- The topic ‘change Out of stock label – Function.php code doesn’t work 4 me’ is closed to new replies.