Here's the situation: I have a site (not my build so I'm still learning it's process) that needs to check if a user has a successful purchase, and if so, display some content. Currently they're using submitted_order_info to check if authorized, but that only works if the order is still in session. In the event it no longer is, that tag doesn't do any good. What tag / check would you use in this case?
1 Answer
If your customers are required to have an account when you checkout I usually just check to see if the user has an entry in the orders channel. So I am going to assume that you have named your channel "orders" I would have something along the lines of:
{exp:channel:entries channel="orders" author_id="CURRENT_USER" status="paid|open" disable="pagination|categories|category_fields"}
<h1>You have purchased something from us!</h1>
{if no_results}
<h2>You should probably go buy something now!</h2>
{/if}
{/exp:channel:entries}
-
Added a status check to make sure failed orders didn't make this work, but otherwise a perfect solution. Dec 23, 2012 at 2:47
-