Hi guys,
not sure if this is strictly an Enfold or WooCommerce ‘thing’ – however, by default out of stock items feature the wording ‘Out of Stock’ but in stock items have no wording.
Is there a way to add ‘In Stock’ wording to in stock items?
Hey joefraser,
Please refer to the following:
Add this to functions.php:
add_filter( 'woocommerce_get_availability', 'custom_get_availability', 1, 2);
function custom_get_availability( $availability, $_product ) {
//change text "In Stock' to 'SPECIAL ORDER'
if ( $_product->is_in_stock() ) $availability['availability'] = __('AVAILABLE', 'woocommerce');
//change text "Out of Stock' to 'SOLD OUT'
if ( !$_product->is_in_stock() ) $availability['availability'] = __('SOLD OUT', 'woocommerce');
return $availability;
}
Best regards,
Jordan Shannon
Thank you
Hi,
No problem. Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon
Sorry, yes – Jordan, thank you very much.
Another one ticked off the list.
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon