Archived topic
woocommerce - change the out of stock message
3 replies · Started by Donna on June 2, 2018
Viewing posts 1–4 of 4
Hi
is there a simple way to change out of stock notice on a product to read sold out instead?
Thank you.
Hi Donna,
with this code snippet:
add_filter( 'woocommerce_get_availability', 'db_custom_get_availability', 1, 2);
function db_custom_get_availability( $availability, $_product ) {
// Change Out of Stock Text
if ( ! $_product->is_in_stock() ) {
$availability['availability'] = __('Sold Out', 'woocommerce');
}
return $availability;
}
Thank you so much for that.
Where do I add it?
Hi Donna,
this article explains the options for adding PHP, i would recommend the Code Snippets plugin that is mentioned:
This archived topic is closed to new replies.