1

This follows on from my previous question.

I am getting all the child products of it's parents by using the following:-

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

I am already fetching values from custom attributes (dropdowns) in simple products using the following:-

$sizing = $simple->getAttributeText('product_size_women');

This works fine, I am able to get the size value for each simple product but this attribute is set as 'Use To Create Configurable Product'.

I cannot fetch the values from a different custom attribute (also a dropdown) that isn't used to create a configurable product though and I suspect this has something to do with how getUsedProducts functions.

I have tried loading the attribute id into an array like below but this has no affect probably because attributes that aren't used to create a configurable cannot be retrieved in this function - I'm unsure.

getUsedProducts(array(id_of_your_attribute), $product)

I'd simply like to get the value of the custom attribute in the same way as I am getting the sizing ones above:-

$sendtofeed = $simple->getAttributeText('attribute_code'));

Can someone point out where I am going wrong?

1

Don't know if it's a hack or the normal way, but you can get the attribute id using

$sizeId = $simple->getResource()->getAttributeRawValue($simple->getId(), 'product_size_women', 0);

and the text using

$simple->getResource()->getAttribute('product_size_women')->getSource()->getOptionText($sizeId)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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