magento 1.9 – Out of Stock associated product but its color swatch appears as product image

Here are the steps to reproduce this issue.

  1. Create a Configurable Product based on Color attribute which has in my case 2 defined values Blue and Grey.

  2. In Images section add 3 images. The first image is used as Base/Small/Thumbnail, and the other two for swatches with these Labels: Blue-swatch, Grey-swatch.

  3. Create 2 Associated Products for each color. In Inventory section you should have Qty >0 and Stock Availability “In Stock”.

Now load the Frontend. You should see as options both colors as bellow.

1

  1. Let’s edit associated product for Grey color. Go to Inventory section and change Stock Availability to “Out of Stock”. Reload the Frontend. Now option Grey disappeared which is correct but look at “MORE VIEWS” block bellow the product image. Now there are two thumbnails instead of one. The new addition is Grey-swatch image just see its title attribute bellow.

2

In conclusion, if one option is not available its swatch should be excluded completely from listing in Frontend. Unfortunately Magento treats its image defined with Label format Color-Name-swatch as a product image and this is definitely a bug.

Please note if you set the associated product to Disable its swatch disappears from MORE VIEWS block. See bellow.

3