1

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?

1
  • what is the error? update the question with that particular error please – MTM Sep 7 '14 at 13:54
1
<?php $_pname= $this->getProduct()->getName(); ?>

    <div class="product-name">
        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_pname, 'name') ?>
    </div>
2
  • Works great thanks! I'm also trying to add a dropdown attribute using <?php echo $_product->getAttributeText('producttype') ?> but get Fatal error: Call to a member function getAttributeText() on a non-object – user3783905 Sep 8 '14 at 6:30
  • $productType = $_product->getTypeID(); From this you can get product type – Anisha Shaikh Sep 8 '14 at 9:34
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.