Replace “Out of Stock” Word with “Sold” or Anything

Replace “Out of Stock” Word with “Sold” or Anything

 

add_filter('woocommerce_get_availability', 'availability_filter_func');

function availability_filter_func($availability)
{
     $availability['availability'] = str_ireplace('Out of stock', 'Sold', $availability['availability']);
     return $availability;
}

 

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments