Incorrect user ID used in "view order history" link after placing order

Posts: 67
Joined: 02/20/2008

I was doing a test order tonight, and noticed that when I was signed in as a customer and completed the order, I was taken to the screen with the link that says "click here to view your order history." However, when I clicked on the link to do that, I got the "you are not authorized to access this page". I then noticed that the problem is that the user ID is always 2 instead of the appropriate user ID. So for instance, if mu user ID is 9, I should get users/9/orders, but instead the link is to users/2/orders. This seems to be happening regardless of which user I'm signed in as. When I first sign an and get the "Click here to view your order history" link, that link has the correct user ID.

Is there a setting I need to change to fix this, or is it something else?

Thanks.

Posts: 5625
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

There was a mistake in the default checkout completion message settings that caused this, though it's been fixed since. The issue is that the default message uses the current user's uid for that link. However, if the checkout messages page gets saved, it'll be saved with the uid of whoever saved the form. To fix this, go to your checkout messages settings form and change the URL for the "click here" link to use the token [order-url].

Posts: 67
Joined: 02/20/2008

A few problems here:

1) Actually, this was what I found in the settings page:

Thank you for shopping at [store-name]. While logged in, you may continue shopping or <a href="http://www.mysite.com/user/2/orders">click here</a> to view your current order status and order history.

so the user ID of 2 was hardcoded.

2) When I go to the Checkout Messages page, change the message, and hit Submit, the change is not saved for some reason.

3) The URL I want to use is the listing of all the orders for that customer (as the message indicates), not the details page for that specific order (which is what that token is). I don't see another token for user/$uid/orders.

Posts: 5625
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, that's what I was describing. I'd check into the [order-uid] token to make your URL. Also, if you aren't already updated, you should consider updating to the 1.6 release.

Posts: 67
Joined: 02/20/2008

OK, I understand about the token, but I can't get my change to save. Was that what you were talking about? I upgraded to 1.6, but when I make the change to the "checkout completion for logged in users" message field and click Submit, my changes aren't saved.

Posts: 5625
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I'm not sure what to tell you. This is working fine for me on the Livetest, and the code all checked out. Perhaps something else is interfering, like a WYSIWYG editor or something. Puzzled