Add product name to description tab
-
12-12-2019 - |
Domanda
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?
Soluzione
<?php $_pname= $this->getProduct()->getName(); ?>
<div class="product-name">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pname, 'name') ?>
</div>
Altri suggerimenti
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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange