With the following code one can remove the cart items of the currently logged in single customers respectively:
$cart = Mage::getSingleton('checkout/cart'); $quoteItems = Mage::getSingleton('checkout/session') ->getQuote() ->getItemsCollection(); foreach( $quoteItems as $item ){ $cart->removeItem( $item->getId() ); } $cart->save();
With this code one can remove all cart items for all users from Magento shopping cart accordingly:
$quoteCollection = Mage::getModel('sales/quote') ->getCollection() ->addFieldToFilter('is_active', 1); foreach ($quoteCollection as $item) { $item->delete(); }
Large number of customer quotes can be time consuming and resources can hand the server so use the following SQL query that can delete all Magneto all customer cart items:
DELETE FROM sales_flat_quote WHERE is_active = 1;
is_active = 0 means those quotes have been converted into orders, i.e. customer has placed order for those quotes.
is_active = 1 means quotes that have not been ordered, i.e. quotes present in the shopping cart of customers
App usage is growing steadily without showing any signs of slowing down. Hence, it is no surprise that mobile applications…
As the world has grown more digital, businesses have adapted themselves. An effectual adaptation includes online advertising. Offline advertising styles…
Step into a world where apps dance to the user's tune. Picture Instagram, a photo-sharing sensation that swept the globe.…
COVID-19 has led to a digitalization of lifestyle. As patients are taking their mental and physical health more seriously, healthcare…
Introduction WordPress, an immensely popular content management system (CMS), powers over 40% of the internet. What makes WordPress even more…
For moving companies trying to capture their market share amidst stiff competition, a tip or two about what they can…