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;
} 

Share

Posted in PHP, WooCommerce, WordPress

You can also read...