line item : let user to choose value from product display

My client need to sale training.
the product display has a collection field : date + location reference

When the customer put in the cart the training, I need to ask him which collection he choose.

So how can I add a selection field in the line item which get the value of the node product display?


Posted: Sep 27, 2013


CptAnt on September 30, 2013

Maybe the date + location reference should be product variations and not on the product display. That way the info is recorded in the Line Item.

tOf on October 1, 2013

thanks for you reply.
The fact is that a person is in charge of create the content type with date and location, and another one decide which content type will be sold on the site. Evry content type need a date and location to display, just few will be attached to a product.
So I can't put the date and location fields to the product......

CptAnt on October 1, 2013

Surely it would be simpler if each content type was created as a product which could then have the attributes attached and set to null unless they are required.. You could always prevent the add to form from showing if you don't need it.

As an example from my test site (Yes I know it looks horrible)


Notice zeta has 3 select boxes and savona has two but they are using the same product display.

Maybe i am not completely understanding what you are trying to do. I believe you have a content type which displays site wide and may or may not be sold. You could do it as a product which has a "is for sale" checkbox.

Perhaps you could use an entity reference field on the product display to reference the content you want. How you get the date/location info into the line_item is an interesting proposition. Rules might do it but you may have to resort to doing it with a module.