I need to display on homepage a list of colors of products available at the moment in the particular store view.
- Products have color attribute (the default attribute which exists in Magento just after installation).
- There are many colors but not all colors are associated with products yet.
- There are a few store views and each has different products (so also the list of colors on homepage will be different in each store view).
- If color is associated only with products that are out of stock, it shouldn't be on the list of colors on homepage.
Based on this thread: https://stackoverflow.com/a/9562720/2461702 I was able to accomplish first part of the job: get the list of colors which are associated with products.
How to filter this list further so that it contains only the colors which are associated with:
products that are NOT out of stock?
products from the current store view?
products from selected category?
Is there any easy way to speed up the code posten in: https://stackoverflow.com/a/9562720/2461702 ?