Menu Close

How to change out of stock text in woocommerce

Codeamend

Code Snippet to change out of stock text to sold in woocommerce

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;
} 
Posted in PHP, WooCommerce, WordPress

You can also read...