Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I want that the all product/item on the cart will be empty and add the current selected product/item on the cart. Could the be possible?
Mage::helper('checkout/cart')->getQuote()->removeAllItems(); should do the trick for removing all items. How you add the "current product" depends on the context.
Required, but never shown