I feel like the flexibility of Magento would allow for my problem to be fixed but I haven't found anything as of yet.
So essentially I need to get the attribute value for a child product of a configurable product. So far all I can do is in the view.phtml file:
if ($_product->getTypeId() == 'configurable')
{
$confAttributes = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);
print_r($confAttributes);
}
But that is from the parent scope of things. Basically my problem is that I need to get the images of the child products but when I go through a loop like this...
if ($_product->getTypeId() == 'configurable')
$_child_products = $_configurable_model->getUsedProducts(null, $_product);
for ($i = 0; $i < count ($_child_products); $i++){
<?php echo $this->helper('catalog/image')->init($_child_products[$i], 'image'); ?>
}
But now that is the scope from the perspective of the child product. I need to somehow correlate the child product with the attribute value that it takes on (for use with jQuery and image manipulation).
So is there any way that I can get some information from the child_product's perspective that can link it to the attribute?