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)
1k views Asked by Kripa At
3
There are 3 answers
0
On
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: