Discussions

Is it possible to pass info from the content display to the cart?

Let me explain my situation so I can show why I need this. Maybe there is a better solution.

I am trying to develop a site for a photographer. He wants many options available to purchase. Different print styles, types of paper, styles of mounting, all of which will have size options as well.
Dealing with these attributes on Ubercart was a nightmare. There was no good way to organize them. After seeing the demo with the coffee mug, Commerce seemed like it would offer me a solution to my problem.

So I set up a product type for each print medium, and created a product for each size. Then created a display type as directed. The first difference from the coffee mug example is that instead of putting the image in each product so the pic changes when the product changes, I put the image into my content display. My reasoning is the image will never change, only the options.

Well anyone who knows commerce can guess what happened next. All looks okay on the product page, except when I add to cart it just adds the print style and size, with no reference to which photo was selected.

Is there another way I should I approach this? Or go back to Ubercart and deal with the attribute nightmare there?

Posted: Apr 25, 2014

Comments

peterwgnd on May 7, 2014

I'm not sure I understand your problem. You say you don't want the picture to change – because its always the same – but you have different pictures?

If what you mean is you have a product type – a mug which a user can select a picture to have printed on it, if I understand correctly – and you want the product display to show only the picture of the uncustomized mug (without whatever picture they've decided they want printed on it), then you need to do two things. 1. What you've done adding the picture of the uncustomized mug to the product display is correct. 2. You need to set up a product attribute list with a term reference. In the vocabulary add an image upload field (if you want people to be able to see the possible images they can add), then add the field to your product variation as a term reference and enable product attribute (add to cart form). Check here for a guide to creating product attributes: http://www.drupalcommerce.org/user-guide/product-attributes-variations