When customers log in and click on the Account link, the all see one particular person’s past orders and invoices rather than their own past orders and invoices. I’ve tried clearing the cache to no avail.
It may be that they are seeing the orders of another person who is logged in or who most recently logged in. (A customer saw the orders of another person who had just made a purchase.) I logged in and saw the orders of the most recent successful purchase on the site. Then after I logged in I logged off and logged in as another person. Then I saw the orders from the account I had just logged in as prior to logging in with the test account. I’ll try to make it clearer:
1. Person made a purchase and presumably saw their orders because they did not complain (and they had downloads to complain about if their account page was wrong).
2. Another person creates an account and logs into the site and sees the orders of the person in number 1 above. They did not make an order (until the problem is solved).
3. I receive complaint and log into the site with my account. I also see the orders of the person in number 1 above rather than my own test orders.
4. I log in with a second test account of mine and see the orders of the account I logged in as in number 3 above.
5. I log in with a third test account of mine and see orders from the account I logged in as number 3 above.
6. I again log in as the person in number 3 above (my actual account) and now see my correct orders.
7. I log in with a test account and still see the orders from the account listed in number 3 above.
I don’t know how to summarize the problem except to say that it appears that a new person logging in is seeing the orders from the last person who logged in with orders.
Strange and pretty major problem for this live site.
Strange and pretty major problem for this live site.
It’s not really strange. This is an EE channel entry thing, not a CartThrob thing. If your channel entry tag is wrong, it can show entry data that’s not relevant to the current user.
This is a working (simple) example of the correct syntax.
get rid of the entry_id.you’re looking for details of an order, rather than a product id. I guess we should call entry_id: product_id instead. But we didn’t. Sorry. It would be more obvious.
Sorry, I’m afraid that didn’t work. I log in as different test accounts and see all past purchases for all customers. (I even had to raise the PHP Memory setting so the page would load.) The invoice shown in the “view invoice” link for all products shown seems to show the information from the last person who made a successful purchase—all purchased items have this same person as the purchaser rather than the actual purchaser.
The invoice shown in the “view invoice” link for all products shown seems to show the information from the last person who made a successful purchase—all purchased items have this same person as the purchaser rather than the actual purchaser.
Let’s simplify. I’d like to confirm that this works:
For either simplified code sample, it shows orders from one account. In fact, I don’t need to be logged in to see the orders from the account’s orders which are displaying. I’ve tried clearing the EE cache and looking at the pages in different browsers. Here’s what’s happening with the code you provided:
1. I log in as myself and see my orders.
2. I log in as a second party and still see the orders from the account in item 1 above.
3. I log in as a third party and still see the orders from the account in item 1 above.
4. I remain not logged in and also see the orders from item 1 above.
The only caching I could find turned on was Administration—> Global Channel Preferences—> Cache Dynamic Channel Queries?. It was set to yes, I’ve now set it to no, cleared the cache and still have the problem. The template caching was not on for either my test page or the accounts page.
The page is back to showing all orders for all users when I’m logged in as myself (user id #1) when I use my old account page and showing only my orders when using your suggested simplified code. User ID #1’s orders are shown if I log in as another user or don’t log in at all.
I don’t have caching on the templates, nor SQL Caching that I can find. I did have “Cache Dynamic Channel Queries?” turned on in Global Channel Preferences.
It may be now that your simplified code is working. I am able to log in between two of my different accounts and see two different sets of orders.
However, using my code I see all orders made by all users in both accounts.
I’ve now revised my account page and I am no longer seeing all orders with my account. My problem may be resolved. I’ll let you know. Thanks for your help.
This post helped me out as well. I had “Cache Dynamic Queries” enabled under global preferences. I turned it off and it is working properly now. If for instance I did leave global on but used cache=“no” in the actual “exp:channel:entries” tag would that override the global dynamic query caching for this item?
Yeah, I was reading through the docs for EE and you are correct this has been disabled and removed as an option from the admin with the recent versions.