Magento – Edit the default empty value attribute

magento-1.7

By default we will show empty value attribute in the frontend – in product detail page (product additional information). The empty Magento dropdown attribute will show as “No” or “N/A”.

This is a solution to hide all empty value attribute :

If you have found “attributes.phtml”, find and replace following coding:

FIND:

  htmlEscape($this->__($_data['label'])) ?> productAttribute($_product, $_data['value'], $_data['code']) ?>  

REPLACE:

 getResource()->getAttribute($_data['code']); if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>  htmlEscape($this->__($_data['label'])) ?> productAttribute($_product, $_data['value'], $_data['code']) ?>   

I would like an other solution, i will change the default empty value attribute to '*'. I would your help for that. I can't found where i edit this default value.
Thanks

Best Answer

The values No or N/A is specified in the block class Mage_Catalog_Block_Product_View_Attributes, to change this behavior you should rewrite this class and apply your own logic.