tor, 17/05/2012 - 16:14
I bestemte version af Magento kan man opleve at tomme egenskaber vises som N/A, her er et fiks til at rette dette.
- Åben følgende fil i en editor:
/frontend/default/DIT_TEMA/template/catalog/product/view/attributes.phtml
- Find følgende sektion af kode:
<?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; ?>
- Udskift sektionen med denne:
<?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; ?>
- Gem filen og ryd din cache.