2

Here's the scenario:

  • I'm selling furniture. I have a chair we'll call Mission Chair.
  • The Mission Chair comes in oak or maple, both are priced differently. I have a field in my product
  • I have a product display created which references these 2 products
  • Customers need to choose 1 of 5 stain colors, but each type of wood has 5 different choices (and they're not the same choices)
  • The stain choice is required, but does not affect the price.

In my Product Variation Type, I have a term reference field which is referencing a Wood Species vocabulary.

I assume I would create a term reference field on the line item type where they would make the stain color choice. What I need to figure out is how do I do some kind of contextual filter to only show the stains available for the chosen wood species? (which is a taxonomy term on the chosen product - not the display, the product variation)

Should the stains be child terms in the same vocabulary as the wood species, or should it be a separate vocabulary with an additional term field that references a specific wood species (taxonomy reference, the same vocabulary the product variation uses) for each stain color term, and then filter on that somehow?

  • Are you trying to use the standard Commerce Add to Car form (which has support for multiple attributes, and some limitations) or did you come up with a custom add to cart form? – acrosman May 27 '16 at 19:28
  • The standard Add to Cart form - just need to figure out how to do some kind of contextual filter - maybe using a views field on the line item type so I can do a contextual filter? – Eric Wenger May 27 '16 at 19:41
1

You have two basic approaches you can use: either treat the stain color as a customization or treat it as a second attribute. Which you pick depends on a little on your backend process needs and the experience you want to provide.

If you use a second attribute and have a product variation for each stain in each wood, Commerce's default add to cart form should provide the user experience you are describing. You might find it helpful to take a look at this tutorial.

If you want to treat stain as a customization you'll likely want a couple extra modules -- in particular Commerce Customizable Product. Commerce Guys have a tutorial covering that scenario.

  • Trying to avoid creating product variations for this - I have enough other variations to worry about which I didn't mention :-) – Eric Wenger May 27 '16 at 20:28
  • Than you'll want to treat them as product customizations (which probably makes some sense). – acrosman May 27 '16 at 20:30
  • I found this thread (drupal.org/node/1873396) which probably describes a situation somewhat similar to mine. I don't need to adjust the price based on the stain color - I just need some way of triggering a filter of the line item taxonomy reference field (or views field which would be a list of filtered taxonomy terms) based on a chosen term from the product variation - does that make sense? – Eric Wenger May 27 '16 at 20:31

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.