Scenario:
A store catalog is populated with configurable products each having several children with different sizes and colors. As the goal is to show the different color variations, only the children's visibility is set to Catalog, Search
while the configurable parents' visibility is set to Not Visible Individually
.
Issue:
The catalog is currently showing every size variations for each color when ideally only a single variation per color should be showing.
Attempted Solution:
A unique attribute based on both the configurable parent SKU and color was created.
$collection->getSelect()->group($attribute);
This solution would be working correctly on a flat collection grouping, however it can cause conflicts with the different aliases used within EAV collection queries.