cancel
Showing results for 
Search instead for 
Did you mean: 

Configurable Swatch Issue on Category Pages

Configurable Swatch Issue on Category Pages

We would greatly appreciate help with the following issue.

 

We are offering t-shirts that can be configurable by more one attribute. For example, a t-shirt that is available in multiple sizes and multiple colors. In the same category, we have t-shirts that are available in only one color but with multiple sizes.

 

The problem we are having is when configurable swatches are enabled on the product listings, the color option is showing for both the t-shirts that have multiple color options and also for the t-shirt with only one color (it shows a label with the color name). If the t-shirt does not have any color options, then a swatch should not show.

 

Example Details:

T-Shirt 1: Available in Small, Medium and Large and also in Red and Blue - the configurable swatch shoes the "red" and "blue" option on the category pages

 

T-Shirt 2: Available in Small, Medium and Large and only in Red - the configurable swatch incorrectly shows a label for "red"

 

We believe there is a problem in the swatches-product.js file that makes all products show the color options if at least 1 product in the category is configurable by color.

 

Any help would be greatly appreciated.

 

 

3 REPLIES 3

Re: Configurable Swatch Issue on Category Pages

Hi @msecomm,

 

Help to understand a little bit more the problem.

So if you have products with 1 option, you don't want to show that option?

Can you share a screenshot with the error?

Re: Configurable Swatch Issue on Category Pages

Dear Damian,

 

Thank you for your response. Please a screenshot as follows with more clarification:

 

t-shirt config color: configurable by size and color

t-shirt config1: configurable by size only

 

Our setting is to show color swatches on the category pages, however, this should only show when there are color options.

 

When these two products are shown on the same page (see screenshot), the t-shirt config1 shows the only color option it is (while it should not show). If we remove the "t-shirt config color" product from the same page, t-shirt config1 shows correctly without the swatch.

 

We need that both products display correctly when showing on the same page, i.e. t-shirt config1 (no swatches since it is not configurable by color), t-shirt config color (2 swatches - blue and green).

 

Any help would be greatly appreciated.

 

 

Screen Shot 2017-10-26 at 12.50.50 PM.png

Re: Configurable Swatch Issue on Category Pages

Hi @msecomm,

 

Well, if I don't missundertand the idea, the beahvior you are describing is the out-of-the-box behavior of Magento (and has sense... I guess).

I understand that it will be better to not show a configurable product with all the options when an option has only one possible value but you won't be able to achieve that with customization or a module (I don't remember right now if there is a module that allows you to do that, you should perform your own search there).

 

I can imagine some crazy ideas with some automation creating or enabling some products when the main configurable has only one option in one attrbiute but it will require coding.

Some (crazy) ideas:

 

  • Programatically create the new configurable with only size when the main configurable lose stock. In that case you can disable the main configurable and enable the new one.
  • When the main configurable gets more stock, you can disable the second configurable.
  • At the end, you only sell the SKU of the simple product so I believe you won't get troubles with the stock and to know which product did you sell.

You can achieve this working with the stock events (you can validate the stock change of each product and then execute the process I've tried to describe).

As I said, this is a custom solution (the idea of). Maybe you can double check at the Magento's Marketplace if there is a module that can help you.