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?

È stato utile?

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top