I need to show on the product page (frontend) that the current item is for backorder ONLY and is not in stock.
I have at the moment those in stock showing qty of what is available and those products on backorder doesn't show anything.
Does anyone know a code I can put in the view.phtml file that will ONLY show a message on those products set as backorder?
Thanks!
Simon.
To do this make sure you have enabled backorders from inventory tab.
If you are on product page then first of all retrieve product qty.
<?php
$inventory = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
if( (int)$inventory->getQty() == 0 && $inventory->getBackorders() )
{
// No Backorders => getBackorders() = 0
// Allow Qty Below 0 => getBackorders() = 1
// Allow Qty Below 0 and Notify Customer => getBackorders() = 2
echo "display your backordedr message";
}
?>
You can also put this code in
app\design\frontend\base\default\template\catalog\product\view\type\default.phtml
file where availability message of product come from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With