0

On the product page, I would like to create a new tab next to the description tab named 'What's Included'.

I have created a attribute with text area named included to display what items that come with a product.

Here is the section of code in the local.xml file of the theme for the tabs:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >

            <!-- Product description -->
            <action method="addTab" translate="title" module="catalog"><alias>description</alias><title>Product Description</title><block>catalog/product_view_description</block><template>catalog/product/view/description.phtml</template></action>

If I duplicate the Product Description tab code above it will add another description tab but I do not know how to change it to be the included tab.

Also, I understand that I need to create .phtml file such as included.phtml but do not know what to put in that file to display the included attribute info.

1

Please follow bellow steps

Step : 1

Add included tab code in local.xml file (add code after line no. 388)

<action method="addTab" translate="title" module="catalog"><alias>included</alias><title>What's Included</title><block>catalog/product_view_attributes</block><template>catalog/product/view/included.phtml</template></action>

Step : 2 Create new file included.phtml in location (app\design\frontend\ultimo\default\template\catalog\product\view)

and add bellow code in file

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct()
?>
<?php if ($_included = $this->getProduct()->getIncluded()): ?>
    <h2><?php echo $this->__('included') ?></h2>
    <div class="std">
        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_included, 'included') ?>
    </div>
<?php endif; ?>

Note : Please clear magento Cache in admin side

1

I had successfully created tab with your above method. If i had to add a second tab to this, what changes has to be made to the following line

<action method="addTab" translate="title" module="catalog"><alias>included</alias><title>What's Included</title><block>catalog/product_view_attributes</block><template>catalog/product/view/included.phtml</template></action>
0

This is info from Fortis theme which is identical to Ultimo. Hope this helps.

To add more tabs you would need to customize the theme, by default there are two tabs. More blocks can be added the same way as the block_product_tab1/2 were added. Please see these files as an example:

  • app/design/frontend/<ThemeName>/default/layout/local.xml
  • app/design/frontend/<ThemeName>/default/template/catalog/product/view/tabs.phtml

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.