Add product name to description tab
-
12-12-2019 - |
Frage
I've tried adding:
<div class="product-name">
<h1><?php echo $_helper->productAttribute($_product,$_product->getName(),'name') ?></h1>
</div>
to description.phml but receive an error.
Do I have to make a new block for product name and then add that via local.xml?
Lösung
<?php $_pname= $this->getProduct()->getName(); ?>
<div class="product-name">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pname, 'name') ?>
</div>
Andere Tipps
Try this
<div class="product-name">
<h1><?php echo $_helper->productAttribute($this->getProduct(), $this->getProduct()->getName(), 'name') ?></h1>
</div>
in this ddescription.phtml $_priduct object is not exits
you got the error
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange