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

Page 2 of 9
Adding New Product Tabs on Modern Theme
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

hi there

i am trying to add tabs to my site http://www.officegrabs.com i set it up a temp site to test it the url is http://dev.officegrabs.com

here is what i did

i went into

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

and add it this to the page

<action method="addTab" translate="title" module="catalog"><alias>specification</alias><title>Specification</title><block>catalog/product_view_Specification</block><template>catalog/product/view/Specification.phtml</template></action>

<action method="addTab" translate="title" module="catalog"><alias>iteminclude</alias><title>Item Includes</title><block>catalog/product_view_iteminclude</block><template>catalog/product/view/iteminclude.phtml</template></action>

next i went into
/app/design/frontend/default/defiance/template/catalog/product/view
and i add it this 2 files there
specification.phtml
iteminclude.phtml

i am attaching the files so you can see what i did

next i went into
app\Code\core\Mage\Catalog\Block\Product\View\
and i add it this 2 files
specification.php
iteminclude.php
i am attaching the files so you can see what i did

and now that i check on the site
http://dev.officegrabs.com
i dont see any tabs

p s i refreshed the cache

File Attachments
iteminclude.phtml  (File Size: 1KB - Downloads: 256)
catalog.xml  (File Size: 21KB - Downloads: 216)
specification.php  (File Size: 1KB - Downloads: 217)
iteminclude.php  (File Size: 1KB - Downloads: 218)
specification.phtml  (File Size: 1KB - Downloads: 266)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

now i am getting this error

Fatal error: Call to a member function setTemplate() on a non-object in /home/offiscom/public_html/magneto/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php on line 60

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

hi mrtech i got resloved this problem but i dont know is this is a proper way
please make ur php file first alphabate capital
for eg: your file name is “specification.php” rename it “Specification.php”
and
“iteminclude.php” rename it “Iteminclude.php”.

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

hi mrtech i got resloved this problem but i dont know is this is a proper way
please make ur php file first alphabate capital
for eg: your file name is “specification.php” rename it “Specification.php”
and
“iteminclude.php” rename it “Iteminclude.php”.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

hi

thank for all your help !

i renamed the files and i am still getting this error

class Mage_Catalog_Block_Product_View_Specification extends Mage_Core_Block_Template { protected $_product = null; function getProduct() { if (!$this->_product) { $this->_product = Mage::registry(’product’); } return $this->_product; } } class Mage_Catalog_Block_Product_View_Specification extends Mage_Core_Block_Template { protected $_product = null; function getProduct() { if (!$this->_product) { $this->_product = Mage::registry(’product’); } return $this->_product; } }
Fatal error: Class ‘Mage_Catalog_Block_Product_View_Specification’ not found in /home/offiscom/public_html/magneto/app/code/core/Mage/Core/Model/Layout.php on line 461

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

hi
i have downladed ur file and have make the change.Im uploaded ur file pls downlaod it and save in there places.....

File Attachments
iteminclude.phtml  (File Size: 2KB - Downloads: 290)
specification.phtml  (File Size: 2KB - Downloads: 215)
catalog.xml  (File Size: 21KB - Downloads: 333)
Specification.php  (File Size: 2KB - Downloads: 220)
Iteminclude.php  (File Size: 2KB - Downloads: 225)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

hi

can you let me know what you hade changed in the files
just for my records i shuold know what was wrong

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

hi
your two pages Specification.php and Iteminclude.php was not in a perfect format of php thats y it was not pulling the code u can compare your code and my code both code r same but my code is in perfect php format and nothing else

enjoy
bye

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

now i am getting this error

Fatal error: Cannot redeclare class Mage_Catalog_Block_Product_View_specification in /home/offiscom/public_html/magneto/app/code/core/Mage/Catalog/Block/Product/View/Iteminclude.php on line 46

 
Magento Community Magento Community
Magento Community
Magento Community
 
vij
Sr. Member
 
Total Posts:  81
Joined:  2009-02-13
 

hi
downlaod the file and try again
i think now it will be work

File Attachments
Iteminclude.php  (File Size: 2KB - Downloads: 251)
Specification.php  (File Size: 2KB - Downloads: 185)
 
Magento Community Magento Community
Magento Community
Magento Community
 
mrtech
Sr. Member
 
Total Posts:  87
Joined:  2008-06-30
 

now i am getting this error

Warning: include(/home/offiscom/public_html/magneto/app/design/frontend/default/default/template/catalog/product/view/Specification.phtml) [function.include]: failed to open stream: No such file or directory in /home/offiscom/public_html/magneto/app/code/core/Mage/Core/Block/Template.php on line 144

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vicky
Member
 
Avatar
Total Posts:  50
Joined:  2008-09-28
 

I’m using the default theme and I would like to update it with tabs.  Can I follow this method?

 
Magento Community Magento Community
Magento Community
Magento Community
 
craichead
Jr. Member
 
Total Posts:  28
Joined:  2008-08-28
Greeley, CO
 

how would you suggest to simply add a tab that shows static information and not product attribute info.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 
sktung - 25 November 2008 08:53 PM

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

Unfortunately this doesn’t work to prevent the tab from being drawn on the page, all it does is prevent any code outside the if statement from being executed.

Anyone have any ideas on how to add some intelligence into the mix so the tab will only show up if there is content in the attribute?

 
Magento Community Magento Community
Magento Community
Magento Community
 
skicrave
Member
 
Total Posts:  51
Joined:  2007-12-02
 

Correction to my above post, that does work to effectively prevent the tab from being drawn if there is no content in the attribute.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 9