Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9879

    I would like to be able to hide the number of inventory available for my variable products. Is this possible? To just have it say “In stock” or “Out of stock”

    #66137

    Hey!

    Add following code to css/custom.css or the quick css field:

    .stock { display:none; }

    Regards,

    Peter

    #66138

    Thanks Peter for the quick response. Although this doesn’t really work. It hides the stock availability entirely. Where as, for example, I have a shirt for sale on my store. And I have Mediums and Larges but no smalls. If I select small now, it does not tell me that there are none left. It lets my select and hit the “add to cart” button. But of course, nothing goes to the cart. Which would probably drive a customer nuts cause there is nothing alerting them that there are no smalls left.

    #66139

    Would really appreciate some help on this. Thanks.

    #66140

    Anything?

    #66141

    I haven’t found a way to hide some text parts only (woocommerce is simply not flexible enough here). You can hack the core plugin files however this is quite tiring because you need to do this mod everytime a new plugin version is released. Open up woocommerceclassesclass-wc-product.php and search for:

    if ($this->backorders_allowed()) :
    if ($this->backorders_require_notification()) :
    $availability = __('Available on backorder', 'woocommerce');
    else :
    $availability = __('In stock', 'woocommerce');
    endif;
    else :
    $availability = __('Out of stock', 'woocommerce');
    $class = 'out-of-stock';
    endif;

    Change the code to:

    if ($this->backorders_allowed()) :
    if ($this->backorders_require_notification()) :
    $availability = __('Available on backorder', 'woocommerce');
    endif;
    else :
    $class = 'out-of-stock';
    endif;

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Hiding Inventory Numbers’ is closed to new replies.