Question

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?

Was it helpful?

Solution

<?php $_pname= $this->getProduct()->getName(); ?>

    <div class="product-name">
        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pname, 'name') ?>
    </div>

OTHER TIPS

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 exitsyou got the error

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top