I'm facing a weird problem. I'm working on magento mobile theme (1.7). We have a header with a checkout icon pointing to: http://sitename.com/checkout/onepage/

When the user visits the site, a popup is shown for login. When he logins, the page simply reloads and if he has cart items, we show the checkout icon which links to the above given url.

The problem is, for the first time when user clicks the link, it redirects to http://sitename.com/checkout/cart/.

The cart page again has the same link. If the user clicks again on the checkout link, it moves to proper url: http://sitename.com/checkout/onepage/

I'm not able to find why it is moving to the /cart/ url for the first time instead of going to /onepage/. And why it is moving to /onepage/ for any other time.

Please help me on this

3 Answers 3


I am not 100% sure that I understand you but could you please check this:

Login to Magento Admin.

Goto System -> Configuration -> Customer Configuration -> Login Options.

In the dropdown there is option of where to redirect customer once they are logged in.

i.e. Redirect Customer to Account Dashboard after Logging in or not.

  • Thanks Amit for the answer. No, it is not related to Login Options. I'm on the home page, I login and the page reloads back. Everything is fine upto this point. I can see the number of items in my cart icon at the top. If I hover my mouse on the cart icon, I can see the URL to be /checkout/onepage. But when I click on it, I see the cart page with url /cart. If I click on the login icon again, I move to the /onepage url.
    – Ashutosh
    Sep 2, 2015 at 14:50

I don't have the right solution, because it's a complex case and I don't know if you have custom or 3rd party modules installed in your site, however I can suggest what I would do in order to find the problem:

  1. Log out / Log In
  2. Check if your checkout link is actually pointed to checkout URL if the url isn't the right one, the problem must be in the URL generation somewhere in a phtml or block, if URL it's ok then go to step 3...
  3. Debug the current quote object - Save/log Quote Object data in some place
  4. Click the link to be redirected to Cart.

    At this point check the system.log and exception.log for some error.

  5. Once in the Cart debug again the Quote Object
  6. Compare Step3 Quote Data Vs Step5 Quote Data

So... if you find some difference between objects, you must find the way to change the quote data to avoid the error or misconfiguration that is redirecting you to the cart, generally reseting some quote data like address could be enough, but you must find the base problem first.


You can debug quote data using:

$quoteData = Mage::getSingleton('checkout/session')->getQuote()->getData();

But, be Careful here, the quote object is really big and many properties like shipping/billing_address has the quote itself as property, so if you want to log data using: Mage::log($quoteData) first transform addresses, payment and other nested objects to array and then unset the quote object, inside them to avoid recursion.

I'm pretty sure that using this workaround you'll find the solution, or the base problem at least.


I found the solution and really apologize to post the answer so late.

On mobile theme, the onepage was actually includes cart and there was an item in the cart which was on pre-order(out of stock).

That's why it was not showing the whole onepage and only cart.

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.