Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Customers see wrong past purchases in Account link
Posted: 07 June 2012 11:57 AM   [ Ignore ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

[ Edited: 07 June 2012 12:23 PM by Crossover ]
Profile
 
 
Posted: 09 June 2012 11:23 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

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.

{exp:channel:entries channel="orders" limit="30"  dynamic="no" author_id="CURRENT_USER"}
    {author}
    {entry_id}
                                    
{
/exp:channel:entries} 

 

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 09 June 2012 11:25 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

You have to set a parameter to look for content from the current member. author_id=“CURRENT_USER”

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 09 June 2012 08:09 PM   [ Ignore ]   [ # 3 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

I have the problem despite having the author_id=“CURRENT_USER”.  But, I’m sure I have a problem with my code, I just can’t find it.  Here is my code:

{exp:channel:entries channel="purchased_items" limit="30" dynamic="off" author_id="CURRENT_USER" status="open|Completed"}       
{exp
:cartthrob:order_items order_id="{purchased_order_id}" entry_id="{purchased_id}" }
<div class="product">
<
h3>{item:title}</h3>
{if item:product_thumbnail}
<a href="{path='{template_group}/detail/{item:entry_id}'}">
<
img  src="{item:product_thumbnail}" class="float_left" height="70">
{/if}

<p>
Purchase Price{item:price} (wtax{item:price_plus_tax})
<
br /><a href="{path={template_group}/detail/{item:entry_id}}">Review &raquo;</a>
<
br /><a href="{path={template_group}/invoice}/{purchased_order_id}">View invoice &raquo; </a></p>
{if item:product_download_url}
{exp
:cartthrob:download_file_form field="product_download_url" entry_id="{item:entry_id}" }
<input type="submit" class="listbutton" value="Download Now!" /> 
{/exp:cartthrob:download_file_form}
{
/if}
         
{if purchased_license_number}
<p>License number{purchased_license_number}</p>
{/if}
<br />
</
div>
{/exp:cartthrob:order_items}
{if no_results}
You haven
't made any purchases yet.
{/if}
{/exp:channel:entries} 

 

Profile
 
 
Posted: 11 June 2012 11:37 PM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

change this

{exp:cartthrob:order_items order_id=”{purchased_order_id}” entry_id=”{purchased_id}” }

to this:

{exp:cartthrob:order_items order_id=”{purchased_order_id}” }


http://cartthrob.com/docs/tags_detail/order_items/#order_id

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.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 12 June 2012 07:12 AM   [ Ignore ]   [ # 5 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

[ Edited: 12 June 2012 07:17 AM by Crossover ]
Profile
 
 
Posted: 12 June 2012 12:28 PM   [ Ignore ]   [ # 6 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

  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:

{exp:channel:entries channel="orders" limit="30"  dynamic="no" author_id="CURRENT_USER"}
    {author}
    {entry_id}
                                    
{
/exp:channel:entries} 

 

And this as well.

{exp:channel:entries channel="purchased_items" limit="30" dynamic="off" author_id="CURRENT_USER" status="open|Completed"}    

{title}
<br />
{author}<br />
{purchased_order_id}<br />
{purchased_license_number}<br />
 
{/exp:channel:entries} 
 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 12 June 2012 02:52 PM   [ Ignore ]   [ # 7 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

Profile
 
 
Posted: 12 June 2012 03:30 PM   [ Ignore ]   [ # 8 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

I bet you have either template caching, sql query caching turned on, or another type of caching active on that page.

http://expressionengine.com/user_guide/general/caching.html

On pages that handle dynamic data, you should definitely turn off caching.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 12 June 2012 04:00 PM   [ Ignore ]   [ # 9 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

[ Edited: 12 June 2012 04:04 PM by Crossover ]
Profile
 
 
Posted: 12 June 2012 04:18 PM   [ Ignore ]   [ # 10 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

[ Edited: 12 June 2012 04:41 PM by Crossover ]
Profile
 
 
Posted: 12 June 2012 07:18 PM   [ Ignore ]   [ # 11 ]
Has a Great Personality
Rank
Total Posts:  48
Joined  2011-03-02

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.

Profile
 
 
Posted: 05 September 2012 06:14 AM   [ Ignore ]   [ # 12 ]
Is a Really Great Dancer
RankRank
Total Posts:  87
Joined  2011-09-23

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?

Thanks,
James

Profile
 
 
Posted: 05 September 2012 09:45 AM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10240
Joined  2008-09-29

would that override the global dynamic query caching for this item?

No. Regardless, I think that query caching is no longer an option for current versions of EE. I could be wrong, but I thought they’d deprecated it.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 05 September 2012 10:00 AM   [ Ignore ]   [ # 14 ]
Is a Really Great Dancer
RankRank
Total Posts:  87
Joined  2011-09-23

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.

Profile
 
 
   
 
 
‹‹ Shipping_first_name?      CARDSAVE ERROR ››