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

Tabs Aanmaken
 
Erik need help
Jr. Member
 
Total Posts:  12
Joined:  2009-12-14
Netherlands
 

To create a new tab; for example, we sell handmade body creams so we needed a tab for descriptions of the fragrances:

Step 1: 

Created a file in notepad called scents.phtml
and upload this file to:  /app/design/frontend/default/modern/template/catalog/product/view/scents.phtml

<?php if(count($this->getProduct()->getScents())): ?>
<div class="product-specs">
<?php echo $this->getProduct()->getScents() ?>
</div>
<?php endif; ?>

**MAKE SURE THERE ARE NO SPACES at all after the last

>
just keep hitting delete after it, I spent hours before i realized that white space was making it so that the tab was still showing even if there was no information in it.  Hitting delete after the last > fixed it.

Step 2:

Created a file in notepad called Scents.php (Make sure the first letter is UPPERCASE)
and upload this file to:  /app/code /core/Mage/Catalog/Block/Product/View/Scents.php

<?
class Mage_Catalog_Block_Product_View_Scents extends Mage_Core_Block_Template
{
    
protected $_product null;

    function 
getProduct()
    
{
        
if (!$this->_product{
            $this
->_product Mage::registry('product');
        
}
        
return $this->_product;
    
}
}

Step 3:

Open app/design/frontend/default/default/layout/catalog.xml

and find

<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>

And enter the following code after it:

<action method="addTab" translate="title" module="catalog"><alias>scents</alias><title>Scents</title><block>catalog/product_view_scents</block><template>catalog/product/view/scents.phtml</template></action>

ik heb deze stappen gevolgd om tabs proberen aan te maken maar het probleem zit bij stap 3
ik kan de line van addtab niet vinden in de file catalogus.xml

topic:http://www.magentocommerce.com/boards/viewthread/19498/P60/#

heeft iemand hier oplossing voor of kan mij hiermee helpen?

File Attachments
catalog.xml  (File Size: 22KB - Downloads: 145)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Gui
Guru
 
Avatar
Total Posts:  588
Joined:  2008-03-09
 

Als die er niet instaan kan gebruik je denk ik de default theme. Download Modern them of de Blue skin en dan heb je een goed overzicht.

Ik kan je de code wel geven voor catalog.xml maar volgens zijn er ook nog wat andere bestanden nodig om de tabs werkzaam te krijgen die standaard in die andere themes zitten.

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