when I am using this code $product->getAttributeText('attribute_code');
It always return false
in one of my script.
and if I do below way then it return right value why ??
$attr_option_val = Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'attribute_code');
$product->setData('attribute_code',$attr_option_val);
echo $product->getAttributeText('attribute_code');
Best Answer
Based on the comments...
If you are getting the product from a collection of simple products associated to the configurable product you need to add this in the
config.xml
of your module in order for your attribute to be picked upand clear the cache.