Magento – Disable “Only X left Threshold” Qty from Showing on Store

cataloginventoryinventorystock

Anyone know how to remove the "Only # left" from showing on the product page of the store?

System > Configuration > Inventory for Stock Options has the field "Only X left Threshold" set to "0" which is suppose to disable this yet it still shows. I've also set Manage Stock to No for Product Stock Options. I've done the obvious with clearing cache. I'm running 1.8 ver and to have a Custom Theme installed. Is this a known bug or could the Custom Theme be overriding something?

Best Answer

in the file

app\design\frontend\default\YourTheme\template\catalog\product

the following lines need to be changed.

        <div class="availability-only">
            <?php echo $this->__('Only') ?> 
            <?php echo (int)($qtyStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty());?>
            <?php echo $this->__('left') ?>
        </div>

Add the first line and the last line. The finished code should look like this:

        <?php if ($this->displayProductStockStatus()): ?>
            <div class="availability-only">
                <?php echo $this->__('Only') ?> 
                <?php echo (int)($qtyStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty());?>
                <?php echo $this->__('left') ?>
            </div>
        <?php endif; ?> 
Related Topic