0

I have an observer on the customer login event. I want to redirect the user to the cart page after login.

I have this in my function from my controller:

Mage::app()->getFrontController()->getResponse()->setRedirect('/checkout/cart/');
Mage::app()->getResponse()->sendResponse();
exit;

The fact is that in firefox this code works. In chrome it doesn't. In chrome I always get an empty cart , even if I have products in my cart, just after page refresh I got the items from my cart. What should I change in my code to make this work in chrome too ? Thank you in advance !.

1 Answer 1

0

Try this with removing some '/'

Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
Mage::app()->getResponse()->sendResponse();
exit;
4
  • If I change /checkout/cart into checkout/cart, so without the first "/" , I am redirected to customer/account page :| Commented Nov 15, 2016 at 9:01
  • @AttilaNaghi, Now check my updated answer Commented Nov 15, 2016 at 9:06
  • Still the same on chrome :( . My project is on a subdomain. so my url is like test.servername.io/checkout/cart. I don't know if this is a problem or not .. Commented Nov 15, 2016 at 9:09
  • @AttilaNaghi, It may be the browser issue. Check in other system or in some other browsers. Commented Nov 15, 2016 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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