использовать это событие sales_quote_merge_before
поместите это в config.xml
<events>
<sales_quote_merge_before><!--calling this event before merging the old cart with newly added cart items while login-->
<observers>
<ws_clearoldcartproducts_observer><!--unique identifier name for our observer-->
<type>singleton</type>
<class>Ws_Clearoldcartproducts_Model_Observer</class><!--Our observer class name-->
<method>loadCustomerQuote</method><!--Method to be called from our observer class-->
</ws_clearoldcartproducts_observer>
</observers>
</sales_quote_merge_before>
</events>
положить это в Observer.php
public function loadCustomerQuote()
{
$customerQuote = Mage::getModel('sales/quote')
->setStoreId(Mage::app()->getStore()->getId())
->loadByCustomer(Mage::getSingleton('customer/session')->getCustomerId()
);
if ($customerQuote->getId() && $this->getQuoteId() != $customerQuote->getId())
{
// Removing old cart items of the customer.
foreach ($customerQuote->getAllItems() as $item)
{
$item->isDeleted(true);
if ($item->getHasChildren()) {
foreach ($item->getChildren() as $child) {
$child->isDeleted(true);
}
}
}
$customerQuote->collectTotals()->save();
}
else
{
$this->getQuote()->getBillingAddress();
$this->getQuote()->getShippingAddress();
$this->getQuote()->setCustomer(Mage::getSingleton('customer/session')->getCustomer()) ->setTotalsCollectedFlag(false) ->collectTotals() ->save();
}
return $this;
}
Ссылка на эту ссылку