List of products bought by the user
Hello,
I am new with Drupal Commerce, but not with Drupal. I set up a small webshop selling e-learning courses.
I use commerce-7.x-1.7.
I would like to make a page where an authenticated user can see a list of products (courses) bought earlier. (So not the admin, but the user himself.)
It should be something like the 'User order' view, but listing all the products already purchased (by multiple orders).
Is there a way for that?
Thanks.
Comments
Yes there is, via Views.
Yes there is, via Views.
Set up a view querying for line items. Now add the relationships "line item:product" and "line item: order id" (or similar). Now you can add a third relationship "Order: Owner". This will enable you to set up a contextual filter on the uid of the owner, using this third relationship. With the first relationship, you can display informations about the product. The second relationship allows you to group by order and display the informations about the order.