B-219 Sec-55 Noida, India
+918010221733

How to delete a quote in Magento

Use the code below to delete a quote:

<?php
$quoteID = Mage::getSingleton("checkout/session")
->getQuote()->getId();

if($quoteID)
{
try {
$quote = Mage::getModel("sales/quote")->load($quoteID);
$quote->setIsActive(false);
$quote->delete();

return "cart deleted";
} catch(Exception $e) {
return $e->getMessage();
}
}else{
return "no quote found";
}
(Visited 37 times, 1 visits today)

Leave a reply