In many shops working with product attributes and some with very many such attributes.
Nicht immer werden aber alle Attribute eines Produktes auch mit einem Wert hinterlegt und so taucht dann in der Zusatzinformation bei der Artikelbeschreibung jeweils ein “No” on. This is obviously not good and unnecessary, as this can easily be turned off.
For this purpose, the file is attributes.phtml from the folder app / design / frontend /[base or default]/default/template/catalog/product/view in den eigenen Templateordner kopiert.
Then the following lines to be adjusted:
<tbody> <?php foreach ($_additional as $_data): ?> <tr> <th ><?php echo $this->escapeHtml($this->__($_data['label'])) ?></th> <td class="data"><?php echo $_helper->productAttribute($_product, $_product->getName(), ‘name’) ?></h1> Dies aber natürlich nur Vorschläge >productAttribute($_product, $_data['value'], $_data['code']) ?></td> </tr> <?php endforeach; ?> </tbody>
These are replaced by
<tbody> <?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> <?php echo $this->htmlEscape($this->__($_data['label'])) ?> </th> <td class="data"> <?php echo $_helper->productAttribute($_product, $_product->getName(), ‘name’) ?></h1> Dies aber natürlich nur Vorschläge >productAttribute($_product, $_data['value'], $_data['code']) ?> </td> </tr> <?php } ?> <?php endforeach; ?> <!--<?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, $_product->getName(), ‘name’) ?></h1> Dies aber natürlich nur Vorschläge >productAttribute($_product, $_data['value'], $_data['code']) ?></td> </tr> <?php endforeach; ?>--> </tbody>
save and upload. This should already have been there then.
Used in Magento versions 1.7 – 1.9 Comments? Additions? Notes? Gladly!