I am working on magento 1.9.2 RWD theme and I am trying to display the product additional info via custom attribute.
I have created the attribute –
Admin Default Store View
faq FAQ
I added a new block FAQ in the layout.xml and it is displaying on the product page.When I am adding an cms block it is displaying properly.
But When I am trying to get the value of faq attribute through admin panel it is giving error and not displying. My code of faq.phtml in the product/view/faq.phtml are as follow-
/**
* Product description template
*
* @see Mage_Catalog_Block_Product_View_Description
*/
?>
<?php
$_product = $this->getProduct();
//$pid= $_product->getId();
//$_product = Mage::getModel('catalog/product')->load($pid);
/* $ids = $_product->getCategoryIds();
$categoryId = (isset($ids[0]) ? $ids[0] : null); */
?>
<?php
if($_product->getFAQ()){ ?>
<?php echo $_product->getFAQ();?>
<?php } ?>
I am getting the below Error:
Fatal error: Call to a member function getFAQ() on null in /home/berkowitsclinic/public_html/hairwits.com/app/design/frontend/rwd/default/template/catalog/product/view/faq.phtml on line 107
please help.
Best Answer
Login you admin Catalog->attribute->Mange attribute select faq
change Used in Product Listing should be Yes