zend framework - product show in stock in admin order when it is in out of stock Magento -
hi trapped in strange situation, client has enable customers order products out of stock , problem when customer place order shows product in stock in order . need show product status out of stock in order come know order item status . below settings have in catalog-> inventory in admin
please suggest me doing mistake or how can
thanks
you need modify product.phtml inside app/design/frontend/{yourpackage}/{yourtheme}/template/catalog/product/view.phtml
add following in code scope testing , checking if not showing out of stock .
$stockitem = mage::getmodel('cataloginventory/stock_item'); $resource = $stockitem->loadbyproduct($_product->getid()); if(round($resource->getqty(),0) < 1) { echo "product out of stock"; } the above code tests if there quantity available in stock , greater 1. make note not work products setup not managed stock under inventory tab in product add/modify case.
thanks
Comments
Post a Comment