I tried with multiple codes to try and sort the collection of associated products based on the position of the attribute value but without success.
With my foreach in the product page I have pulled out all the records of the associated products but are always shown by order of id and not by position of the value they have with the attribute. This is my situation:
In this way I take the collection of associated products:
$conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
$simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
How can I get the correct order S, M, L, XL, XXL? Thanks