0

I just add some additional attributes on magento stores and I see it on product detail page. But when I duplicate this code below, its not working. I need to add 2 custom attributes so I will have, DESCRIPTION (which is already given), SPECIFICATION (custom), DELIVERY (custom) and REVIEW (given) TABS.

I'm editing it on catalog.xml file

 <block type="catalog/product_view_attributes" name="product.attributes" as="additional" template="catalog/product/view/attributes.phtml">
        <action method="addToParentGroup"><group>detailed_info</group></action>
        <action method="setTitle" translate="value"><value>Additional Information</value></action>
 </block>

1 Answer 1

2

I accomplished this in 1.9 CE by adding the following code to local.xml within the layout folder of my theme (you can create the file if it is not there already):

<layout version="0.1.0">
<catalog_product_view>
<reference name="product.info">
    <block type="catalog/product_view_description" name="product.models" as="models" template="catalog/product/view/models.phtml">
        <action method="addToParentGroup"><group>detailed_info</group></action>
        <action method="setTitle" translate="value"><value>Models Supported</value>    </action>
    </block>
</reference>
</catalog_product_view>
</layout>

and adding the following file to magentoroot/app/design/frontend/themepackage/themename/template/catalog/product/view/models.phtml

 <?php  $ingredients = $this->getProduct()->getData('model_support'); 
 echo $ingredients;
 ?>

In this case 'model_support' represents the particular attribute I have chosen to display, you must reference a relevant attribute within your store. Also verify that the attribute properties is set to yes, Visible on Product View Page on Front-end.

Also I wanted to prevent the Additional Data tab from displaying, so I also added the following code:

<reference name="product.info.tabs">
    <action method="unsetChild">
        <child>product_additional_data</child>
    </action>
</reference>

Note: you will need to update your paths to use the relevant paths for EE and your theme configuration

7
  • Hi Joshua, I cannot find my local.xml? Is this something I should create and upload it? If I will upload it, what directory should it be? Commented Aug 20, 2014 at 2:45
  • Yes you can create the file using notepad and name it local.xml, place the file into your magento installation at this path: magentoroot/app/design/frontend/themepackage/themename/layout/local.xml
    – Joshua34
    Commented Aug 20, 2014 at 2:51
  • Hi Joshua, I followed your instructions but in my case, it doesn't seem to work? hhmm Commented Aug 20, 2014 at 2:56
  • Try to verify your attribute settings, I edited my answer
    – Joshua34
    Commented Aug 20, 2014 at 2:58
  • I corrected the models.phtml code and also please verify that the attribute code matches a working attribute on your store.
    – Joshua34
    Commented Aug 20, 2014 at 3:01

Your Answer

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

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