Skip to main content
Added tags
Source Link
Piyush
  • 5.9k
  • 9
  • 34
  • 66

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used

$cart = Mage::getSingleton('checkout/cart'); //getModel
                                $cart->init(); 
                                $cart->addProduct($product, $qty);                                // update session
                                $session->setCartWasUpdated(true);
                                $cart->save();
                                $quote->setIsActive(1);
                                $quote->collectTotals()->save();
                                Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used

$cart = Mage::getSingleton('checkout/cart'); //getModel
                                $cart->init(); 
                                $cart->addProduct($product, $qty);                                // update session
                                $session->setCartWasUpdated(true);
                                $cart->save();
                                $quote->setIsActive(1);
                                $quote->collectTotals()->save();
                                Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used

$cart = Mage::getSingleton('checkout/cart'); //getModel
$cart->init(); 
$cart->addProduct($product, $qty);  // update session
$session->setCartWasUpdated(true);
$cart->save();
$quote->setIsActive(1);
$quote->collectTotals()->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used $cart = Mage::getSingleton('checkout/cart'); //getModel $cart->init(); $cart->addProduct($product, $qty); // update session $session->setCartWasUpdated(true); $cart->save(); $quote->setIsActive(1); $quote->collectTotals()->save(); Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

$cart = Mage::getSingleton('checkout/cart'); //getModel
                                $cart->init(); 
                                $cart->addProduct($product, $qty);                                // update session
                                $session->setCartWasUpdated(true);
                                $cart->save();
                                $quote->setIsActive(1);
                                $quote->collectTotals()->save();
                                Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used $cart = Mage::getSingleton('checkout/cart'); //getModel $cart->init(); $cart->addProduct($product, $qty); // update session $session->setCartWasUpdated(true); $cart->save(); $quote->setIsActive(1); $quote->collectTotals()->save(); Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

cart is empty after add to cart (in private window working fine) magento 1.9.2 programmatically.

i've used

$cart = Mage::getSingleton('checkout/cart'); //getModel
                                $cart->init(); 
                                $cart->addProduct($product, $qty);                                // update session
                                $session->setCartWasUpdated(true);
                                $cart->save();
                                $quote->setIsActive(1);
                                $quote->collectTotals()->save();
                                Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
Source Link
Mahendra
  • 716
  • 1
  • 10
  • 24
Loading