getSummaryQty() is not working properly magento

191 views Asked by At

I used this function for delete cart items. It is working properly but

 $cartHelper = Mage::helper('checkout/cart');

 foreach ($itemProductArray as $itmeid => $productid) 
 {
        $cartHelper->getCart()->removeItem($itmeid)->save();
 }

getSummaryQty() function gives old quantity value. Anyone help please?

1

There are 1 answers

0
drdrak3 On

A little bit unclear, but I am assuming you need the getSummaryQty for a block, possibly the sidebar/minicart block or something similar.

If this is the case, make sure you have performed all of your quote modification functionality before the loadLayout() in the current controller, or at least before the block in question is initialized.

Alternatively but not really recommended is to refresh/redirect the page after the cart save.