I’ve searched and searched and searched and couldn’t find anything. Does anyone know how to create a new product tab? I’m creating a new attribute called “Sizing Chart” and I want to stick that info into a new product tab called “Sizing Chart”. Your help is appreciated.
Can’t help you with this but I can give you a pointer as I just took a look at the tabs file this morning.
Thought JS is used, The tabs in the Modern theme isn’t called via DOM or Ajax but xml ( I maybe mistaken). Go to the ‘catalog.xml’ file, in the ‘Product view’ section , look for
Thanks for the reply as always chinesedream, Thats exactly where I’m stuck. The tab shows on every product page but I cant figure out how to show the content of the custom attribute. I set the attribute as a textfield type. Anyone else tried doing this?
It worked really well, but the only problem I have now is that if I create a new tab, the information in that tab still shows up under the “Additional Information” tab.
I’m pretty sure that the key file is Attributes.php which appears to build the array to populate this particular tab. However, my PHP is horrible and I am not sure how to use the ? $excludeAttr ? to exclude this information from appearing twice.
As a crude hack, I am able to accomplish this by changing the attribute to not be visible through Magento Admin but I do not believe this is the ideal solution.
also, for those who do not want the tab to appear if there is no data, just use the following code:
Two options:
1) either you completely discard the additional information and you comment the tab out in catalog.xml
2) you go to the attributes.phtml file to discard the info you don’t want to be displayed. Create an if statement around
I tried the instructions above and am now getting the following error.
class Mage_Catalog_Block_Product_View_Included 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_Included 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_Included’ not found in /home/enertcom/public_html/app/code/core/Mage/Core/Model/Layout.php on line 461
class Mage_Catalog_Block_Product_View_Included extends Mage_Core_Block_Template { protected $_product = null;
function getProduct() { if (!$this->_product) { $this->_product = Mage::registry('product'); } return $this->_product; } }
Gives me this error:
class Mage_Catalog_Block_Product_View_Included 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_Included 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_Included’ not found in /home/enertcom/public_html/app/code/core/Mage/Core/Model/Layout.php on line 461
Im getting the same error, please can someone help.
Thanks
class Mage_Catalog_Block_Product_View_Included 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_Included 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_Included’ not found in /home/enertcom/public_html/app/code/core/Mage/Core/Model/Layout.php on line 461
I do not get this error after following these steps. However no tabs show up due, in part I believe, to not having any content to instert in the tabbed area. How do i now add content assuming these steps worked? Lets say for example I want to have a gallery of 4 or 5 videos pertaining to the particular product I am viewing under a “Videos” tab where a thumbnail of the videos would be clickable to have a lightbox open the video and play it?
Or something of the sort so that I can figure out the rest.
Right now, none of the new tabs show up because there is no content for it and I am unsure exactly where to now add content or how to put it into the administration screen so I can edit it’s html like, for example, the description.
Finally got the new tab to work. Now the issue is that even if the attribute is an empty text field the tab still shows up. I tried couple of changes in the tabs.phtml file but not working changes are :
that’s because the tabs are drawn independently of the content of the tabs (in tabs.php).
I’m trying to figure it for myself but it’s a tough nut to crack.
My best guess at this stage is to include a class into the tab style which sets the tab to invisible.
When the tab gets filled by content, then it’s set to display.
I’m not sure if it’s the best option but I don’t have any other trick on my sleeve.