Add product name to description tab
-
12-12-2019 - |
質問
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?
解決
<?php $_pname= $this->getProduct()->getName(); ?>
<div class="product-name">
<?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pname, 'name') ?>
</div>
他のヒント
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
所属していません magento.stackexchange