1

I have my checkout cart page running on https.
When I am applying any coupon or removing, it is not showing any message to the user.
When I am using non secure checkout page, then Magento is showing error or success message on checkout cart page.
Any help in regard to fix this issue would be appreciated.

  • please show and code .\ – Amit Bera Jun 8 '15 at 6:20
  • @AmitBera Which code? code in cart.phtml? – Anshu Mishra Jun 8 '15 at 6:25
1

The issue was due to response was coming to non secure cart page.
To make the things work I have changed redirection in _goBack() function.

<?php

require_once 'Mage' . DS . 'Checkout' . DS . 'controllers' . DS . 'CartController.php';

class Custom_CartFix_CartController extends Mage_Checkout_CartController {

    /**
     * Set back redirect url to response
     *
     * @return Mage_Checkout_CartController
     */
    protected function _goBack() {
        $returnUrl = $this->getRequest()->getParam('return_url');
        if ($returnUrl) {
            // clear layout messages in case of external url redirect
            if ($this->_isUrlInternal($returnUrl)) {
                $this->_getSession()->getMessages(true);
            }
            $this->getResponse()->setRedirect($returnUrl);
        } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart') && !$this->getRequest()->getParam('in_cart') && $backUrl = $this->_getRefererUrl()
        ) {
            $this->getResponse()->setRedirect($backUrl);
        } else {
            if (($this->getRequest()->getActionName() == 'add') && !$this->getRequest()->getParam('in_cart')) {
                $this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl());
            }
            //$this->_redirect('checkout/cart'); 
            $this->_redirect('checkout/cart', array('_secure' => true));

        }
        return $this;
    }

}
  • works perfect. Was facing the same issue. This resolved it. Thanks! But I'm wondering why this happens in the first place!? It can't be true that all shops using secure url in frontend are having this kind of issue. – Stefan Dec 10 '15 at 19:05

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.