0

A small question:

Shouldn't the Help text in the commerce_line_item module at line 1582 that defines the relationship between commerce_line_items and commerce_orders say something like "Relate this entity to the order to which it is attached". As it now stands, the text says "Relate this entity to the line items reference by its commerce_line_items field". Which doesn't seem to make much sense.

0

OK, I think I understand this now, and the Help text is actually correct as it stands.

Each order, it turns out, has a commerce_line_items [note the plural] field attached to it, and it is this field, of unlimited cardinality, that stores all of the commerce_order/commerce_line_item pairs that are associated with this order. What this relationship does, then, is make the commerce_line_item reference field that is stored in the commerce_line_items field available to the view designer. Once this commerce_line_item reference field is available, all of the fields in the commerce_line_item itself become available.

The thing that was confusing is that the commerce_line_items field does not show up in a Site Builder's "Manage Fields" configuration screens, and I had not been able to find it in the code. Many thanks to argiepiano, who showed me where to find the definition of the commerce_line_items field [in the commerce_order module], and the place where data is saved into that field [in the commerce_cart module].

So that is the way that this all works ...

... I think.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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