2

I have many simple products, so consider a product X which is made up of 2 colours eg. red and black.

Now in Layered navigation for filtering

  • if the customer chooses red then the filter should show product X
  • if the customer chooses black then also the product X. Any idea on how to go about this?
  • what about creating a new color option for the combination eg- Red & Black – Piyush Sep 28 '17 at 7:11
  • Wouldnt want to add more colours to the filters until really necessary, looking for a different option as in something where it could be possible to map the product with the colour. Or maybe another way – Sylvester Sep 28 '17 at 7:14
  • if all attributes of the product are same except the color, you can create a configurable product based on color, this way it will show all the available color in one product regardless of the filtered color – Piyush Sep 28 '17 at 8:10
  • yeah but isnt it a simple product made up of 2 colours in this example, configurable would mean that I can have a simple product of red and simple product of black, but my question says if a single product is made of colors such as red and black, on filtering of red i would want to see this product and similary if filter of black i would still want to show the same product. – Sylvester Sep 28 '17 at 8:24
  • it that case ,can you tell me how did you assigned two color to a single product? – Piyush Sep 28 '17 at 8:37
2
+50

My Suggestion is that,

You should create an multi select attribute.

Best Solution is

  1. Export all product with its respective color value.Take database backup.
  2. Delete Color attribute.
  3. Create a multi attribute with same attribute code.With enable in layer navigation. Assign this attribute to attribute set.
  4. Import all product color.
  5. Do the indexing and Cache flush.

Now,As the attribute is multi select, you can set multiple color for products.

  • i tried making a multi select attribute and yes it worked. For a single product with multi colours the filter showed the colors and it was exactly what i wanted. thank you so much! – Sylvester Oct 3 '17 at 5:42
  • coool. nice to hear that – Amit Bera Oct 3 '17 at 5:43
1

Unfortunately, I don't think there is a way to achieve this without creating an additional attribute.

Since your products have more than one color and you want the system to know this information then you should use a multiple select attribute: search_color. The search_color attribute should have the same options as you color attribute, and you should use this attribute instead of color in your layered navigation.

0

Your product X need to be a Configurable product. From this Configurable product you can create or assign Simple products (on Simple product by color available).

Tuto on this subject for Magento 2 : How to create configurable product.

Next, switch your simple products visibility to Not visible individually. And I think you should reindex : php bin/magento indexer:reindex.

Now only your Configurable products are available in search and layered navigation, but containing all color variant in it. So if you search for black one, your Configurable product is display. And if you search for a red one, it is displayed too. Because your Configurable products contains (at least) a red simple product and a black simple product.

In Magento 1, I didn't implement that sort of things, but there is Configurable products too. For layered navigation display, may be you will have to adapt something to works with M1.

Hope that helps

  • Well as I added in the question comments, I am talking about product which is simple and having 2 colours. And yes its a single simple product with 2 colours(design). So any other suggestion regarding this? – Sylvester Sep 30 '17 at 12:37
  • Oh, well, I realize I didn't entirely understand your question. You just want be able to select two (or more) colors for a same product ? But (for the moment) you can just have one ? That's right ? – Nicolas PERNOT Sep 30 '17 at 12:57
  • Yes your right.. something like extending the current functionality – Sylvester Oct 1 '17 at 14:12

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.