Menu Close

How to change out of stock text in woocommerce


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;

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


Posted in PHP, WooCommerce, WordPress

Leave a Reply

Your email address will not be published. Required fields are marked *

You can also read...