Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Adding custom tabs to product description page - Blanco theme
 
pmaheepala
Jr. Member
 
Total Posts:  4
Joined:  2012-10-23
 

Hello all,

I am trying to add a custom tab to Product Description page and the theme I am using is Blanco. You can see an example by visiting here. We already have one in place and I am planning to add a second one.

This is what I’ve done so far.
1 ) Created a static block called “shipping_custom_tab”
2) Opened the ‘catalog.xml’ added a new block. Here’s now it displays now:

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
                    <
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>
                    <
action method="addTab" translate="title" module="catalog"><alias>additional</alias><title>Additional Information</title><block>catalog/product_view_attributes</block><template>catalog/product/view/attributes.phtml</template></action>
                    <
action method="addTab" translate="title" module="review"><alias>product_review</alias><title>Reviews</title><block>review/product_view_list</block><template>review/product/view/list.phtml</template></action>                                  
                  <
block type="cms/block" name="product_custom_tab">
                        <
action method="setBlockId"><block_id>product_custom_tab</block_id></action>                      
                     </
block>
                    <
block type="cms/block" name="shipping_custom_tab">
                      <
action method="setBlockId"><block_id>shipping_custom_tab</block_id></action>                        
                     </
block>                                                                                                               
                </
block>

3) Opened the tabs.phtml file and this is the top part of it:

<?php if ($tab != $this->getChildHtml('product_custom_tab')): $last 'last'; endif; ?>

<ul class="product-tabs">
    
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
        <?php 
if($this->getChildHtml($_tab['alias'])): ?>
            
<li id="product_tabs_<?php echo $_tab['alias'] ?>" class="<?php echo !$_index?' active first':(($_index==count($this->getTabs())-1)? $last :'')?>"><div class="tab-left"></div><a href="#"><?php echo $_tab['title']?></a><div class="tab-right"></div></li>
        
<?php endif; ?>
    <?php 
endforeach; ?>
    <?php 
if ($tab $this->getChildHtml('product_custom_tab')): ?>
        <?php $tabTitle 
Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())->load('product_custom_tab')->getTitle(); ?>
        
<li id="product_tabs_custom" class="last"><div class="tab-left"></div><a href="#"><?php echo $tabTitle?></a><div class="tab-right"></div></li>               
    
<?php endif; ?>
 
    
</ul>
<?php foreach ($this->getTabs() as $_index => $_tab): ?>
    <?php 
if($this->getChildHtml($_tab['alias'])): ?>
        
<div class="product-tabs-content" id="product_tabs_<?php echo $_tab['alias'] ?>_contents"><?php echo $this->getChildHtml($_tab['alias']?></div>
    
<?php endif; ?>
<?php 
endforeach; ?>
<?php 
if ($tab $this->getChildHtml('product_custom_tab')): ?>
    
<div class="product-tabs-content" id="product_tabs_custom_contents"><?php echo $tab ?></div>    
<?php endif; ?>

Now my issue is where to add what code.

I tried duplicating the below part code for “shipping_custom_tab” and it disables the middle tab:

<?php if ($tab $this->getChildHtml('product_custom_tab')): ?>
        <?php $tabTitle 
Mage::getModel('cms/block')->setStoreId(Mage::app()->getStore()->getId())->load('product_custom_tab')->getTitle(); ?>
        
<li id="product_tabs_custom" class="last"><div class="tab-left"></div><a href="#"><?php echo $tabTitle?></a><div class="tab-right"></div></li>               
    
<?php endif; ?>

I tried duplicating this code for “shipping_cstuom_tab” and it duplicated info on the last tab on all other tabs:

<?php if ($tab $this->getChildHtml('product_custom_tab')): ?>
    
<div class="product-tabs-content" id="product_tabs_custom_contents"><?php echo $tab ?></div>    
<?php endif; ?>

Any help is highly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TutorialMagento
Sr. Member
 
Avatar
Total Posts:  133
Joined:  2013-10-02
 

To add custom tabs to your magento theme, you may follow this tutorial
http://tutorialmagento.com/how-to-add-custom-tabs-to-magento-product-page
Hope this’s what you are looking for.
In case you are wondering which hosting is good for a Magento store, take a look at this review on top 5 magento hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
sashas7777
Sr. Member
 
Avatar
Total Posts:  90
Joined:  2012-04-25
New York, USA
 

Hi if you need replace standard magento pages view with one that uses tabs you may be interested in this extension which adds tabs on product page:
http://extensions.sashas.org/product-page-tabs.html

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top