Question

In my store, i am allowing customers to create products like Courses using Drupal 7 Commerce module, Is there a way using views or whatever method to enable the sellers on my site to see orders placed for their products?

Example: If Stanley is Selling Product1 and Product2, he will be able to see orders for product1 and product2, for now only admin can see the orders.

Your help will be highly appreciated.

Was it helpful?

Solution

Yes, you can use Views as Patrick suggests. Make it a View of Order entities with relationships joining Orders to Line Items and Line Items to the referenced Products. You can then apply a contextual filter to only show results whose Product uid matches the currently logged in user's uid.

A couple things to keep in mind...

  1. Such a View would need to "Disable SQL rewriting" in its advanced settings, because it won't work so long as normal entity access control conditions are applied to the query.
  2. You should include in the View itself all the information you need the course seller to see rather than trying to link them directly to a standalone page per Order. If that's what you want, you're going to actually need to hook into the access control system via custom code.
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top