Magento Forum

   
Adding New Product Tabs on Modern Theme
 
fegizii
Sr. Member
 
Total Posts:  160
Joined:  2009-01-21
 
Vicky - 10 March 2009 04:03 AM

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

I don’t think the default theme uses tabs like the modern theme. Look into your catalog.xml and see if you find an addtab function

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

hi
u can add tabs in ur default theme just we have to add some script to xml file and some phtml file in particular folder and than its works

 
Magento Community Magento Community
Magento Community
Magento Community
 
celings
Jr. Member
 
Total Posts:  19
Joined:  2009-02-12
 

I have this working but the ingredients tab has the same information on every product.  Is there any way to have the new tab display unique ingredients for each product similar to what the description does? 

Thanks,
Charlie

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

hi
i thing u have put same text in ur ingreients attribute pls check that or u havent created a attribute for ungredients can i know that frm whr ur ingredients tab geting the txt.........

enjoy

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

hi
i think u have put same text in ur ingredients attribute pls check that or u havent created a attribute for ingredients can i know that frm whr ur ingredients tab getting the txt.........

enjoy

 
Magento Community Magento Community
Magento Community
Magento Community
 
celings
Jr. Member
 
Total Posts:  19
Joined:  2009-02-12
 

vij,

works great! thanks for taking the time to reply

Charlie

 
Magento Community Magento Community
Magento Community
Magento Community
 
jarhody
Jr. Member
 
Total Posts:  20
Joined:  2009-03-10
 

I have everything working. Set up a tab based on a single attribute. It only shows when populated, however if I clear the field in the backend the tab still shows. I’m assuming it has to do with the php if statement. My php is weak! Please advise.....how can I write the php if statement based on null instead of count? I assume this is the issue because if I delete the database line related to the attribute the tab goes away for that product.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jarhody
Jr. Member
 
Total Posts:  20
Joined:  2009-03-10
 

Sorry my first post may be a little confuning.

I followed weckl’s directions....thanks that was a huge help. Also used sktung’s code to not show the tab. Worked ok, but as soon as I edit and save a product the new tab shows up even if there is no data in the attribute field. How can I write an if statement to check if the attribute field in blank?

Thanx

 
Magento Community Magento Community
Magento Community
Magento Community
 
diver66
Sr. Member
 
Total Posts:  83
Joined:  2008-12-13
 

Hi guys,

just reading through this thread I came to realize that the initial question,” how do I add a tab that only contains text or a size chart” has not been answered, because this is exactly what I am looking for ,
I would like to add a tab that does not hold information from an attribute, but just shows information that I myself put in like an html table or a link to download a pdf ..... how can this be accomplished using 1.3.1 Magento.

many regards from Spain

Joe

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentoassist
Guru
 
Avatar
Total Posts:  528
Joined:  2008-11-19
 

@diver66 - This thread totally answers your question. Just follow weckl’s advice on the first page, but in the equivalent of your ingredients.phtml (whatever you name it), just put whatever the heck you want in that file. It can just be a bunch of text if you want that, or you can pull the value of a custom attribute manually. If you want the same thing to show up for all products, then a text dump in the phtml will be fine. If you want different things to show up for each product, you need to create an attribute whose value is a lengthy text area, fill these in via the admin, and then use the code provided in this thread to pull the values.

@jarhody - What type of attribute are you using? If, for example, it is a yes/no attribute, sktung’s code won’t work because it will insert a default value of “no” into the attribute once the product is created. Try using a different type of attribute that doesn’t have a default value, and it should work.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

Hi, I have this more or less working, just need a little help with not displaying the tab when it has no data to show (the contents of the tab are a text field).

I have edited the catalog.xml file, created a new “Ingredients.php” and “ingredients.phtml” file and the tabs show up correctly. Problem is that they always show, even if empty.

I have tried Sktung’s suggestion in my ingredients.phtml (It’s the only thi ng in my ingredients.phtml), but it doesn’t seem to make a difference. Any sugestions?

Big thanks to this thread!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
magentoassist
Guru
 
Avatar
Total Posts:  528
Joined:  2008-11-19
 

@MacKniven,

Make sure you are using the if statement around *everything* in your ingredients.phtml. Also, go through the file and make sure you don’t have an extra space or carriage return outside of the loop in the file. If you even have one stray space, the tab will render no matter what.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

@ksolaro,

And with the deletion of one single stray carriage return, the script pounces into life!!!!!

You have made me a very happy man. Thanks to you and all others that make this forum the thing that really makes Magento worthwhile!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MacKniven
Member
 
Total Posts:  51
Joined:  2009-01-09
 

@ jarhody

I’m not a php whizz, but I think I had the same issue as you did. I solved it by changing the first line of sktung’s code from…

<?php if(count($this->getProduct()->getIngredients())): ?>

to…

<?php if($this->getProduct()->getIngredients()): ?>

Hope it helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jarhody
Jr. Member
 
Total Posts:  20
Joined:  2009-03-10
 

Thanks, MacKniven....I just figured that out and was going to post it...everything working great now!

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