WooCommerce change out of stock message

To add a custom Out of Stock message on WordPress put the following in your themes functions.php

add_filter('woocommerce_get_availability_text', function($text, $product) {
if (!$product->is_in_stock()) {
$text = 'Currently out of stock';
}
return $text;
}, 10, 2);

 

Gareth
Buy Me A Coffee
back arrowBack to Index