Available qyt on the cart page in Magento 1

 In Blog, Tutorials, Webshops

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 -->

Recommended Posts
Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search