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.

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? – R K Shrivastaw Nov 8 '17 at 11:52
  • if you put any static content in the template , is that visible in product-info tab? – Piyush Nov 8 '17 at 11:54
  • Yes if am adding static block then it is displying. I had cross-checked with a cms block it is displaying. – R K Shrivastaw Nov 8 '17 at 12:19
  • use print_r($_product->getData() and check are you getting faq value in that – Piyush Nov 8 '17 at 12:21

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.