i have faced an issue. i have placed order but cart not empty after order success.
i have used $session->clear();
but no luck. anyone have idea to solve this. my successAction
code is bellow.
public function successAction()
{
$notallowed = $this->getRequest()->getParam('na', false);
if ($notallowed) {
$this->_redirect('checkout/onepage');
return;
}
$session = $this->getOnestepcheckout()->getCheckout();
if (!$session->getLastSuccessQuoteId()) {
$this->_redirect('checkout/cart');
return;
}
$lastQuoteId = $session->getLastQuoteId();
$lastOrderId = $session->getLastOrderId();
$lastRecurringProfiles = $session->getLastRecurringProfileIds();
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
$this->_redirect('checkout/cart');
return;
}
$session->clear();
$this->loadLayout();
$this->_initLayoutMessages('checkout/session');
Mage::dispatchEvent('checkout_onepage_controller_success_action', array(
'order_ids' => array(
$lastOrderId
)
));
$this->renderLayout();
}
Best Answer
Please try to blow edited code and let me know it work or not.