WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. RobJonze
    Member
    Posted 7 months ago #

    Hi,

    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.

    http://london-calling.com.sg/shop/

    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
    Volunteer Moderator
    Posted 7 months ago #

    You need to post on the WC forum:

    http://wordpress.org/support/plugin/woocommerce

Reply

You must log in to post.

About this Topic