2

My project involves multiple users selling products on the site. I am liking the simple displays of the Commerce Reporting module and I am wondering if it can be set up per user.

For example :

User1 when logged in would see sales reports that relate to them (all products created by that user).

User2 when logged in would only see products they created.

What I can see so far is that I have Views options to display Views Blocks of these charts on a specific page. That way i can make duplicate views and add a relationship. This is now where i get stuck. In the relationship options of these specific views there are no "user id" options.

List of relationship options

Commerce Order: Owner

Commerce Order: Payment Transaction

Commerce Order: Referenced customer profile

Commerce Order: Referenced customer profile

Commerce Order: Referenced line items

Commerce Order: Representative payment transaction

Commerce Order revision: Order

Commerce Order revision: User

3
  • Please read Handbook drupal.org/node/2334035
    – niksmac
    Dec 18, 2014 at 6:35
  • 1
    Thanks for the link however I do not see any info in the handbook at all. Am I missing something?
    – Anon Ymous
    Dec 18, 2014 at 17:21
  • Any ideas out there?
    – Anon Ymous
    Dec 21, 2014 at 17:39

3 Answers 3

1

This question seems fairly similar to the question "https://drupal.stackexchange.com/questions/141473/how-to-only-include-data-in-a-commerce-reporting-report-about-products-created-b" ... Which has a comment that might be the answer to what you're looking for ... Did "I" hereby answer "this" question?

Aso, while waiting for the Commerce Reporting handbook to get some real content (cfr. your valid comment in the other reply), you may want to look at the Visualization documentation, which includes a link to a video about Commerce Reporting (the Visualization module is the charting API used by the Commerce Reporting module).

Be Aware: I'm a co-maintainer of the Visualization module

3
  • Commerce Reports maintainer here. 4.x does not use Visualization, it uses Charts. Mar 9, 2015 at 18:23
  • Hey Matt, CHARTS maintainer (also ...) here. Thank you for confirming what's documented in bullet nr 2 of drupal.org/node/2389465#facilitatingmodules ... Note the "hint" in that bullet also. It'd be interesting to know the actual GIT commit(s) that are related to that transition. Can you tell? What was the reason for swapping to charts? Also, so "you" (and your module users) are the ones that make the charts install base to keep going up and up, great! Mar 9, 2015 at 18:38
  • 1
    So I became a co-maintainer of Commerce Reports Around Nov 2013 (I think.) At that time Visualization + Reports were very coupled. Which meant maintaining two modules. I can find the commits and make note in that node Mar 9, 2015 at 19:26
0

You need to add a relationship to the Commerce Products through the "Commerce Order: Referenced line items" relationship. From there you should be able to filter on the creator of the product entity.

0

Make a clone of the sales view. Add a relationship commerce-order with line-item. add another relationship line-item with product. add another relationship product with user (creator)

Then add a contextual filter setting the default parameter to be based on current logged in user.

Note the user has to have permission to view any orders in order for the view to work.

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.