-1
$quote = Mage::getSingleton('checkout/session')->getQuote();
        $cartItems  = $quote->getAllVisibleItems();
        foreach ($cartItems as $item) {
            $productId = $item->getProductId();
            $product = Mage::getModel('catalog/product')->load($productId);
        }
        $batch_qty = $product->getBatchQty();

Through this code i can get the batch quantity, same way i need to get the batch quantity in the cart page how can i get this ?

In the cart page i can see the

$_item = $this->getItem();
$isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();

also product name echo $this->escapeHtml($this->getProductName()) why i am not getting batch quantity, i give $_item->getBatchQty(); but it is nothing retrieves.

Naveenbos
  • 2,532
  • 3
  • 34
  • 60
  • did you try putting $batch_qty = $product->getBatchQty(); into the foreach loop? – cleong May 13 '15 at 13:42
  • @cleong that code is on another page, Which is giving exact result, but in cart page is already looped result are getting, but how can i get the batch qty? – Naveenbos May 13 '15 at 13:45

1 Answers1

0
$batchQty = Mage::getModel('catalog/product')->load($_item->getProduct()->getId())->getBatchQty()

Using this method I got the batch quantity.

Naveenbos
  • 2,532
  • 3
  • 34
  • 60