I donβt understand why you just donβt make a custom product based on the size for each color? This way, you donβt have to hack into the way Magento works.
If you create a simple product that is part of a custom product that is visible in the front end, it will not link to a custom product if it is part of one (as you found out). This does not make sense to you, because if your custom products are based on size and color, simple products will have a given size and color.
You would be made fully functional and without hacking if you just created a custom product for each shirt color. Then you can also use related products to show the other colors of the shirts.
The fewer hacks, the better. It's my opinion.
source share