0

I'm getting the child products of a configurable product through this code

 $childProducts = Mage::getModel('catalog/product_type_configurable')
                        ->getUsedProducts(null,$_product);

And in a foreach I'm trying to get a specific attribute value to show up (in this case Storage capacity).

It should display a string like this '32 GB' but instead it is displaying a number like '23'.

 foreach($childProducts as $index => $child){
      echo child->getData('storage_capacity'); // Prints 21 or 22 or 23
 }

I don't know enough about the EAV resource structure to get the associated value for this attribute. Can anyone push me in the right direction?

0

try child->getAttributeText('storage_capacity');

0

Try this:

foreach($childProducts as $index => $child){
      echo $child->getAttributeText('storage_capacity');
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.