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?

marked as duplicate by Raphael at Digital Pianism, Keyul Shah, Amit Bera, Qaisar Satti, Rajeev K Tomy May 17 '16 at 5:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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.