I need to generate a custom XML schema in magento 1.8.0 with some info of my configurable products. In these info, I need to fetch some attributes (size, color) from the simple products for each configurable. This is a relevant piece of my code so far, which generates my XML fine, except the fact I can't find a way to fetch the attributes 'color' and 'shirt_size' from the simple products.
$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToFilter('status', 1);
$products->addAttributeToFilter('visibility', 4);
$products->addAttributeToSelect('*');
$xml = new SimpleXMLElement('<xml/>');
foreach ($products as $product_all) {
$sku = $product_all->getSku();
$price = $product_all->getPrice();
$prod = $xml->addChild('product');
$prod->addChild('product_id', "$sku");
$prod->addChild('price', "$price");
$prod->addChild('color', "");
$prod->addChild('shirt_size', "");
}
print($xml->asXML());
Thanks!