To work with Magento we need to create many attribute for show information about product. But all attribute are no need for all product. For this reason we need to skip some attribute value from backend for some product. If you skip any attribute value from backend, by default Magento shows that attribute in frontend with ‘No‘ value. This create a problem to define product specification properly.
Recently i solved this problem. If you want to hide those attributes from frontend which values are skip from backend, you can follow me-
To do this you have to go:
/app/design/frontend/your-instance-name/your-theme-name/template/catalog/product/view/attributes.phtml
If you not found attributes.phtml file there then you can find that in following location:
/app/design/frontend/base/default/template/catalog/product/view/attributes.phtml
Now open the attributes.phtml and replace all code with following code:
- <?php
- /**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Academic Free License (AFL 3.0)
- * that is bundled with this package in the file LICENSE_AFL.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/afl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category design
- * @package base_default
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- */
- /**
- * Product additional attributes template
- *
- * @see Mage_Catalog_Block_Product_View_Attributes
- */
- ?>
- <?php
- $_helper = $this->helper('catalog/output');
- $_product = $this->getProduct()
- ?>
- <?php if($_additional = $this->getAdditionalData()): ?>
- <h2><?php echo $this->__('Additional Information') ?></h2>
- <table class="data-table" id="product-attribute-specs-table">
- <col width="25%" />
- <col />
- <tbody>
- <!--<?php foreach ($_additional as $_data): ?>
- <tr>
- <th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
- <td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
- </tr>
- <?php endforeach; ?>-->
- <?php foreach ($_additional as $_data): ?>
- <?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
- if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>
- <tr>
- <th class="label">
- <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
- </th>
- <td class="data">
- <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>
- </td>
- </tr>
- <?php } ?>
- <?php endforeach; ?>
- </tbody>
- </table>
- <script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
- <?php endif;?>
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/**
* Product additional attributes template
*
* @see Mage_Catalog_Block_Product_View_Attributes
*/
?>
<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if($_additional = $this->getAdditionalData()): ?>
<h2><?php echo $this->__('Additional Information') ?></h2>
<table class="data-table" id="product-attribute-specs-table">
<col width="25%" />
<col />
<tbody>
<!--<?php foreach ($_additional as $_data): ?>
<tr>
<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>-->
<?php foreach ($_additional as $_data): ?>
<?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>
<tr>
<th class="label">
<?php echo $this->htmlEscape($this->__($_data['label'])) ?>
</th>
<td class="data">
<?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>
</td>
</tr>
<?php } ?>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('product-attribute-specs-table')</script>
<?php endif;?>Then save the attributes.phtml file and upload that in your server. Now delete cache and refresh the product page.








Perfectly worked on 1.7.0.0 version. Thank you