Add fields from product to line item

Currently trying to add additional fields from my customised product type, to the line item so they can be displayed within an order.

I can modify the line item type: product fields to create the location to store the information, but don't know how I would populate that created field with information from the product.

Is this even the right direction to take? It seems a bit redundant to need to store the information twice, but modifying the view of type line items, doesnt seem to provide a way to access fields from the product referenced by the line item.

Any light on the situation greatly appreciated.


Posted: Mar 16, 2011


essbee on March 16, 2011

Wouldn't you know it I've been mucking around with this for 2 days. I finally post a question on it, only to figure it out 2 minutes later.

For anyone interested: in the Line Items Table view you need to create a relationship on the product id. This gives access to the variables form the product.
Obvious really...

partyzan on July 24, 2012

This method would display current state of your product item from your data base but if youll decide to update your products and fields will get different??? Look around rules from admin/commerce/config/product-pricing/rules , hope this will help....

clasie on August 14, 2012

Hello, I have the same issue for days, could you please explain a bit more your idea about looking around rules?

I'd like to add a special reference to a product (dealer ref) and have it visible from the line item of the order. Seems a difficult task for some what a elementary stuff.

Thank you for any clue.