Change the "Out of Stock" Text on Main Shop Page (2 posts)

  1. RobJonze
    Posted 2 years ago #


    I'm a bit stumped on something... how do I change the "Out of Stock" text on the main shop page? We are selling 1 off pieces, and "Out of Stock" doesn't sound right.


    I have added this to my functions:

    add_filter('woocommerce_stock_html', 'change_stock_message', 10, 2);
    function change_stock_message($message, $stock_status) {
        if ($stock_status == "Out of stock") {
            $message = '<p class="stock out-of-stock">Sold</p>';
        } else {
            $message = '<p class="stock in-stock">Available</p>';
        return $message;

    Which works for the single product images, but not for the main page.

    Any help would be much appreciated

  2. WPyogi
    Forum Moderator
    Posted 2 years ago #

    You need to post on the WC forum:


Topic Closed

This topic has been closed to new replies.

About this Topic