Magento get attribute value
To get product attribute value in Magento is very common. You will need it everytime when dealing with catalog products in your development. Attributes have different types, which can be any of Text Field, Text Area, Date, Yes/No, Multiple Select, Dropdown, Price, Gallery, Media Image, Fixed Product Tax (as you can see in backend Manage Attributes > New Attribute > Catalog Input Type for Store Owner). To get the value for these different types of attributes there is no one straight line of code, you will need to use different code for getting values from plain attributes, while different code to get values from select and multiselect attributes.
Get attribute value for PLAIN TEXT, TEXTAREA or DATE type attribute:
$attribute_value = $product->getShirtSize(); //for shirt_size attribute
Get value from SELECT, MULTISELECT, DROPDOWN or YES/NO attributes:
$attribute_value = $product->getAttributeText($attribute_code);
OR
$attribute_value = $product->getResource()->getAttribute($attribute_code)->getFrontend()->getValue($product);
Get value from PRICE attributes:
$attribute_value = $product->getNew_price(); //for attribute code “new_price”
and in product list page,
$attribute_value = $product->getNewPrice();
Get attribute value by attribute code and productID WITHOUT loading whole product
$attribute_value = Mage::getResourceModel(‘catalog/product’)->getAttributeRawValue($product_id, $attribute_code, $store_id);