Displaying an Order History List for Logged-In Members

It’s common to display an order history of past purchases for logged-in members. With CartThrob it is quite easy to do this.

To display a list of past purchases for your members you must do the following. First you will need to require customers to login before purchase. Once logged-in any purchase made will be “authored” and stored with their member id. Order entries and purchase items entries will both be saved with your member’s id set as the author. To display a list of the orders, just set "author_id=CURRENT_USER" in a channel entries tag for your orders channel.

Fig 1. Order History

Order History
Order History
 {exp:channel:entries channel="orders" status="open|complete" author_id="CURRENT_USER"}    Order number {entry_id} : {title}{/exp:channel:entries}  

You can output orders, and purchased items using this same method. If you use custom entry statuses for completed, pending, or failed orders, make sure that you add your custom statuses to the order entries tag.