2

I'm using Drupal Commerce and have created a different product for every variant combination of color and size. For example, if I'm selling a skirt with multiple colors and sizes I'd have a product for "color:blue size:small", "color:blue size:medium", "color:red size:small", "color:red, size:Large", etc.

I created a view for my products and have added exposed filters for color and size to this view. The problem I'm having is that I'm getting duplicates because of the sizes. I don't mind if the filter results show the same skirt twice in different colors, but I don't want results showing duplicates for different sizes. i.e: "color:blue size:small", "color:blue size:medium".

I've tried adding the filter "Content: Product:delta (= 0)", which eliminates size based duplicates. The problem with this is that it also gets rid of color based duplicates, which cause my color filter to stop displaying different colors for the same skirt. For example, if Content: Product:delta (= 0) is added and I set my color filter to red skirts nothing will show in the results.

Is there a way to add a delta (= 0) filter to only the "size" attribute? I'm guessing this would fix my problem if it's possible to do.

This issue has been killing me and I really need it resolved. Any help would be greatly appreciated.

0

1 Answer 1

1

No, that's not possible, the delta=0 will remove duplicates by restricting to the first product in the product reference field. It won't apply selectively to different attributes on that referenced product.

A better option may be to use the colour filter only, then on the product display node itself, add the value to select the size in the add to cart form.

That way, customers can filter by colour, then select the size they want when viewing the product detail.

2
  • Thanks for the response. I'd like for customers to be able to filter by size also because I may have a size "Large" in stock for the blue skirt, but not for the red skirt. Is there a way to create the size variations without having to create a new product for every size? I'm trying to build an exposed filter similar to the one in the sidebar found here: jcpenney.com/dotcom/women/plus-size/dresses/…
    – ace1234
    Commented Sep 23, 2013 at 3:03
  • No, each size is a distinct product with it's own product entity record there. If you're looking for faceted search, you may have more luck with ApacheSolr Commented Sep 23, 2013 at 3:24

Your Answer

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

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