ontwerps

Available qyt on the cart page in Magento 1

For the available qyt on the cart page use below code;


	   	<!-- start available qty to product in app\design\frontend\ultimo\colorfabb\template\checkout\cart\item\default.phtml-->
        < ?php

		$productId = $_item->getProductId();
		$product = Mage::getModel('catalog/product')->load($productId);
		if($product->getTypeId() == "configurable"){
			$sku = $_item->getSku();
			$simpProdId = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku)->getId();
			$product = Mage::getModel('catalog/product')->load($simpProdId);
		}

		$quantity = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
		?>
		<span style="font-weight: bold;color:#ff0000;">Available qty:< ?php echo (int) $quantity;?></span>
		
		<!-- einde available qty to product -->

Comments are closed.