I have an issue with configurable product images. I have configurable products with colour and size attributes and images for each different colour. These images for each colour are uploaded to their respected simple products. When I set up the configurable products I chose one of the simple product's images (so the product in one colour) as the configurable product images, which also means the main image that displays on the category page.
On the product page I use a module that changes the main image and gallery images when the corresponding colour attribute is selected.
This all works well until the colour that is used as the configurable product images and the main category image is out of stock. Now I have an out of stock colour showing as the product image on the category page, so customers will click on a product, expecting to be able to buy it in the displayed colour, but it is not in stock. Obviously not a good customer experience.
The nature of my business means that I may never again get that colour back in stock also, making the scenario even worse.
The only option currently is to manually monitor when a simple product (colour) goes out of stock and ensure that that image is not the one currently being used for the configurable product image, and if it is, upload the images of an in stock colour choice to the configurable product, which is obviously time consuming.
My question is this: is there any way to make Magento pull the product images from the currently in stock simple products (colours) and use these as the images for the configurable product? And when the current images associated simple product goes out of stock, change the images to another random, in stock colour?
I have searched for similar posts and found how to do this the other way round (use configurable images for simple products) but can't find any solution for this.
Thanks in advance and sorry for the lengthy description!