1

Just need little help,If I stay on checkout page and product is out of stock and if I process further step, magento automatically redirect cart page,now I want to find where is code in core files which is match product quantity and if qty is 0 or out of stock it redirect cart page,Just help me to find that code which is redirect cart page from onepage checkout if product is out of stock

I found in core files but still not find code which is redirect cart page from onepage checkout page.Please give me a hint please help me.

1

Mage_Checkout_OnepageController

protected function _expireAjax()
{
    if (!$this->getOnepage()->getQuote()->hasItems()
        || $this->getOnepage()->getQuote()->getHasError()
        || $this->getOnepage()->getQuote()->getIsMultiShipping()
    ) {
        $this->_ajaxRedirectResponse();
        return true;
    }
    $action = $this->getRequest()->getActionName();
    if (Mage::getSingleton('checkout/session')->getCartWasUpdated(true)
        && !in_array($action, array('index', 'progress'))
    ) {
        $this->_ajaxRedirectResponse();
        return true;
    }
    return false;
}

this action is called via ajax progressAction this is called in 233 in

if ($this->_expireAjax() || !$prevStep) {
        return null;
    }
| improve this answer | |
  • No this code is work when click 'proceed to checkout' button from cart page but when I stay on onepage checkout page and checked register radio button and click continue button and when I click continue button that time redirect cart page that time I want to stop redirect to cart page. – Niraj Patel Feb 19 '16 at 6:56
  • that was not mention in question.. – Qaisar Satti Feb 19 '16 at 6:58
  • I mentioned in question that "If I stay in checkout page and I process further steps" – Niraj Patel Feb 19 '16 at 7:05
  • updated the answer... – Qaisar Satti Feb 19 '16 at 7:12
  • Yes, Exactly,Thank for guide me,Just I removed $this->getOnepage()->getQuote()->getHasError() code from if condition in _expireAjax() function and now it is not redirect to cart page ,thanks for help,Thanks a lot once again Qaisar satti. – Niraj Patel Feb 19 '16 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.