How do you create additional tabs on the product page other than the standard ‘Description’ and ‘Tags’ tabs.
I would like to create my own tabs e.g. for Delivery information and Returns, i have already created new attributes for these two items and populated them with information, i have also created two new php files in app/code/local/mage/catalog/product/view for these two attributes and modified my view phtml file to mirror this but i can not get the new tabs to show on the product page, is there something i am missing?
Any instructions on how to achieve this would be appreciated.
5 answers
Dear gareth2977!
The template supported displaying the Addition information of the product.
Please see the entry:
http://www.packtpub.com/article/cate…-magento-part2
there mentioned how to add the addition information for the product
Good luck
I understand how to show the attributes in the additional information tab, but that is not what i am trying to do i would like to be able to create my own tabs with my own information.
e.g. the information i select for my new tab could come from a new text attribute i have set up or just standard html or just plain text/images.
Dear gareth2977!
I am sorry for not being of much help in this case.
This is the code in the view.phtml file that i have at the moment for the tabs, i have highlighted the code i have added.
i have also created two new *.php files in app/code/local/mage/catalog/product/view
Delivery.php
Returns.php
What else do i need to modify to get these extra tabs to work?
<div id="ja-tab-products" class="product-collateral">
<ul class="ja-tab-navigator clearfix">
/*This section was added by me*/
<?php if ($_Delivery = $this->getChildHtml(‘Delivery’)):?>
<li><a href="#ja-tabitem-delivery"><?php echo $this->__(‘Delivery Information’) ?></a></li>
<?php endif; ?>
<?php if ($_Returns = $this->getChildHtml(‘Returns’)):?>
<li><a href="#ja-tabitem-returns"><?php echo $this->__(‘Returns’) ?></a></li>
<?php endif; ?>
/*end of section*/
<?php if ($_description = $this->getChildHtml(‘description’)):?>
<li><a href="#ja-tab-decription"><?php echo $this->__(‘Product Description’) ?></a></li>
<?php endif; ?>
<?php if ($_additional = $this->getChildHtml(‘additional’)):?>
<li><a href="#ja-tabitem-additional"><?php echo $this->__(‘Additional Information’) ?></a></li>
<?php endif; ?>
<?php if($upsell_products = $this->getChildHtml(‘upsell_products’)): ?>
<li><a href="#ja-tabitem-upsell"><?php echo $this->__(‘Upsell Products’) ?></a></li>
<?php endif; ?>
<?php if($product_additional_data = $this->getChildHtml(‘product_additional_data’)): ?>
<li><a href="#ja-tabitem-tags"><?php echo $this->__(‘Product Tags’) ?></a></li>
<?php endif; ?>
<?php if($product_reviews = $this->getChildHtml(‘product_reviews’)): ?>
<li><a href="#ja-tabitem-reviews"><?php echo $this->__(‘Product Reviews’) ?></a></li>
<?php endif; ?>
<?php if($review_form = $this->getChildHtml(‘review_form’)): ?>
<li><a href="#ja-tabitem-reviewform"><?php echo $this->__(‘Write Your Own Review’) ?></a></li>
<?php endif; ?>
</ul>
<div class="ja-tab-content">
/*This section was added by me*/
<?php if ( $_Delivery ):?>
<div id="ja-tab-delivery">
<div class="collateral-box">
<?php echo $_Delivery ?>
</div>
</div>
<?php endif;?>
<?php if ( $_Returns ):?>
<div id="ja-tab-returns">
<div class="collateral-box">
<?php echo $_Returns ?>
</div>
</div>
<?php endif;?>
/*end of section*/
<?php if ( $_description ):?>
<div id="ja-tab-decription">
<div class="collateral-box">
<?php echo $_description ?>
</div>
</div>
<?php endif;?>
<?php if ( $_additional ) : ?>
<div id="ja-tab-additional">
<div class="collateral-box">
<?php echo $_additional ?>
</div>
</div>
<?php endif;?>
<?php if( $upsell_products ): ?>
<div id="ja-tabitem-upsell">
<?php echo $upsell_products; ?>
</div>
<?php endif;?>
<?php if( $product_additional_data ): ?>
<div id="ja-tabitem-tags">
<?php echo $product_additional_data; ?>
</div>
<?php endif;?>
<?php if($product_reviews): ?>
<div id="ja-tabitem-reviews">
<?php echo $product_reviews ?>
</div>
<?php endif;?>
<?php if($review_form): ?>
<div id="ja-tabitem-reviewform">
<?php echo $review_form; ?>
</div>
<?php endif;?>
</div>
</div>
Dear gareth2977!
I am sorry for not being of much help in this case.