0

I have a product type and I sell a number of different items within that category, where most of them have the same 3 options (color, type, voltage). However, I have a couple of products of this type that don't conform to the same option set in that they have an one additional option for the customer to select.

The way I see it, I have two workarounds here, and neither of them seem like it's the "right" way to do it. Either I create a separate product/ variation type with all of the existing options, plus the additional option, or I add the additional option to ALL of my variations, even the ones that don't come with that option and just leave it blank for those products. Neither of these solutions are ideal in that it separates these products from others of their "type" or it creates the possibility for options to become available to the end user that are not possible.

Perhaps this is just me coming from an ubercart background, but I feel that I should be able to create an option that is specific to an individual product. I've scoured the internet and I'm not finding a way to do this, nor am I finding anyone else asking this question and getting an answer. What am I missing here?

1 Answer 1

0

I think you can use Conditional Fields module which can help you in showing and hiding fields based on any other field value.

You can also watch these tutorials in case you need to understand Drupal Commerce in detail.

4
  • I don't think that Conditional Fields is an effective solution in this case. In fact, I think it's counter intuitive to the underlying problem here because it's adding more code to the rest of the product type instead of just being able to add an attribute to "this" specific product variation ad hoc.The fact of the matter is that in the attempt to make Drupal Commerce as flexible and as generalized as possible, it removes so much of the meat of the node- level content in lieu of the abstract entities that there's nothing left to hook into.
    – ixlr8
    Oct 4, 2016 at 22:47
  • 1
    My point, is various sku's are going to be differentiated by different attribute sets, even within the same product category. Lets keep the example simple with the often used "shirt" store. One model of shirt comes in red, blue, green, and orange, and is sized S, M, L, XL. Another model of shirt comes in white, grey, and black, and is sized 2, 4, 6, 8, 10. Those are both "shirt" types, yet their attributes are completely different and never between shall they meet. Am I supposed to have a completely different content type for every product to make it it's own type? That can't be right.
    – ixlr8
    Oct 6, 2016 at 8:51
  • I don't think you need different contentype/producttype. If I have understood correctly you use SKU to distinguish products. To generate unique SKU to different attribtues you can check out this modules: drupal.org/project/commerce_autosku If SKU field settings allow you, you can use tokens to generate SKU as you want.
    – Monsoonpk
    Oct 6, 2016 at 10:56
  • The problem is being able to add attributes to a specific product, and not to a product type. For example, I have a product that has a set of attributes (two choices/ skus) that no other product I carry has. It seems redundant and unnecessary to create an entire product/ variation type that is specific to 1 product set and it will never be used again.
    – ixlr8
    Oct 6, 2016 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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