I have created an attribute named as 'specialtext' for every product.But not getting value of this specialtext field in frontend.Any idea?
Not getting value of attribute(Magento)
1.1k Views Asked by Kripa At
3
There are 3 best solutions below
0

In order to show newly created product attribute you need to add it to the "attribute sets". Have you added this attribute to attribute set?
0

text or textarea field
For these attributes use this:
// specify the attribute code
$attributeCode = 'name';
// build and filter the product collection
$products = Mage::getResourceModel('catalog/product_collection')
->addAttributeToFilter($attributeCode, array('notnull' => true))
->addAttributeToFilter($attributeCode, array('neq' => ''))
->addAttributeToSelect($attributeCode);
// get all distinct attribute values
$usedAttributeValues = array_unique($products->getColumnValues($attributeCode));
hope this will sure help you.
Get attribute value for PLAIN TEXT, TEXTAREA or DATE type attribute:
Get value from SELECT, MULTISELECT, DROPDOWN or YES/NO attributes: