Magento – Adding Custom tab to product page

blockslayoutmagento-1.9phtmltabs

Im looking to add a custom tab to the bottom of my existing tabs found on this page: Example

I don't mind the way i add it, the information that's going to be added there will be the same information throughout the whole website it will be a delivery-information tab which just states all the delivery information. I was thinking either making an attribute and controlling it that way or injecting it directly. I would love to hear anyone's advice and their help.

Kindest Regards

bLAZYY

Best Answer

In your theme's local.xml file, add the following:

<catalog_product_view>
  <reference name="content">
    <block type="core/template" name="delivery_information" template="catalog/product/view/delivery_information.phtml">
      <action method="addToParentGroup"><group>detailed_info</group></action>
      <action method="setTitle" translate="value"><value>Delivery Information</value></action>
    </block>
  </reference>
</catalog_product_view>

This creates a "Delivery Information" tab which calls a custom template (more on this below).

You'll then need to ensure that said custom template exists:

app/design/frontend/[package]/[theme]/catalog/product/view/delivery_information.phtml

From there, you can freely modify the contents of this template; either call an attribute or CMS/Static Block (recommended if your Delivery Information isn't likely to change on a per-product basis), for example:

<?php echo = Mage::app()->getLayout()->createBlock('cms/block')->setBlockId('delivery_information'); ?>

Then create a CMS/Static Block with the Identifier as "delivery_information".

Related Topic