when i add mycustom in product view get error

Call to a member function getName() on null in ..\magento\catalog\view\frontend\templates\product\view\opengraph\general.phtml on line 13

any help?

  • have you created block file? – Abdul Dec 4 '15 at 10:43
  • what is "mycustom"? – Akhil Gupta Dec 4 '15 at 11:36

Try this

<?php echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getName(), 'name') ?>


<?php echo $block->getProduct()->getName() ?>

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.