cancel
Showing results for 
Search instead for 
Did you mean: 

Showing a lead time for back orders

Showing a lead time for back orders

Using 1.9.3.1

I've set my store to allow back orders. When a product is set to "Out of Stock" the "add to basket" button is removed and configurable products can't be configured even if the associated products are available.

So I've set the product to "In Stock" and 0 quantity. The product page says "In Stock" and the customer only discovers that it will be back ordered when they get to the basket and see the message.

Can I find the code that triggers the message in the basket and use that on the product page to display a new attribute "Lead Time" in place of "In Stock"?

1 REPLY 1

Re: Showing a lead time for back orders

In basket, you're probably seeing message from class Mage_CatalogInventory_Model_Stock_Item:

app/code/core/Mage/CatalogInventory/Model/Stock/Item.php, about lines 641 and 645 (slightly varies between Magento versions).

if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NOTIFY) {
    if (!$this->getIsChildItem()) {
        $result->setMessage(
            Mage::helper('cataloginventory')->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1))
        );
    } else {
        $result->setMessage(
            Mage::helper('cataloginventory')->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1))
        );
    }
} elseif (Mage::app()->getStore()->isAdmin()) {
    $result->setMessage(
        Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName())
    );
}

Regarding product page, it's kept on:

app/design/frontend/base/default/template/catalog/product/view/type/default.phtml

app/design/frontend/rwd/default/template/catalog/product/view/type/default.phtml

 

For grouped product type:

app/design/frontend/base/default/template/catalog/product/view/type/grouped.phtml

app/design/frontend/rwd/default/template/catalog/product/view/type/grouped.phtml

 

For bundle product type:

app/design/frontend/rwd/default/template/bundle/catalog/product/view/type/bundle/availability.phtml

 

You can easily find "In stock" strings in those files.

If this response was helpful to you, consider giving kudos to this post.
If this response solved your problem, click accept as solution to help others solve this issue