0

I am working rwd theme customization> I am trying to add a new custom tab under the product info parent tab- My layout.xml block code is :

<block type="catalog/product_view_description" name="product.faq" as="faq" template="catalog/product/view/faq.phtml">

    <action method="addToParentGroup"><group>detailed_info</group></action>

    <action method="setTitle" translate="value"><value>FAQ</value></action>

</block>

I created a custom attribute and visible on frontend - YES - uesd in product listing - Yes my attribute code is 'faq' my faq.phtml is as follow -

<?php 

$_product = $this->getProduct();
if($_product->getFAQ()){ ?>

<?php echo $_product->getResource()->getAttribute('faq')->getFrontend()->getValue($_product);?>

<?php } 
?> 

after doing a long exercise i am unable to display the attribute value on frontend. As I checked the data tables my attribute value are properly inserting in the attribute table. If anyone knows please help me.

1 Answer 1

0

Try below code

<?php if($_product->getFaq()){ ?>
    <?php echo $_product->getFaq();?>
<?php } ?> 
4
  • tried with same code previously. but unable to view under the product- info tab. is there any css issue too? Nov 8, 2017 at 11:52
  • if you put any static content in the template , is that visible in product-info tab?
    – Piyush
    Nov 8, 2017 at 11:54
  • Yes if am adding static block then it is displying. I had cross-checked with a cms block it is displaying. Nov 8, 2017 at 12:19
  • use print_r($_product->getData() and check are you getting faq value in that
    – Piyush
    Nov 8, 2017 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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