0

I try to create an administrative view which lists all products in my drupal commerce installation, where some cols should contain data from the orders in which they appear:

PROD | PRICE | ORDERED
----------------------
one  | 12.-  | -
----------------------
two  | 10.-  | Pete P.
     |       | Anna D.
-----------------------
three ...

But as far as i can see, if i start a view of products, i have no relation to referencing line-items.

If i would start with line-items, i could not have products in my list, which appear in no orders...

1 Answer 1

0

Drupal Commerce does support some reverse reference relationships, but currently there is only a reverse relationship from products to nodes that reference them, not from products to line items that reference them. If I were you, I'd instead make the base table orders, because you can more easily establish relationships from orders to line items to products and get at the same fields that way. We use commerce_order as the base table for shopping cart Views, for example.

1
  • Yes, i thought about starting with orders, but that way i can't list the products that are in NO orders, see my example... Maybe i can do a view of products, where one field is a view of orders?
    – sirtet
    Jan 21, 2014 at 9:19

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.