Shopping Cart – No Message Block on Checkout Cart Page

global-messagesmessagessecureshopping-cart

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.

Best Answer

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;
    }

}
Related Topic