I got a small issue with Magento :
I need to load the content of “Custom Options” during page load, not when I click on the associated tab, for a product creation. This is currently working with Ajax.
I need this because when you open the tab, it loads automatically some new options.
Tabs from General to Gift Options are loaded automatically, and the rest is load on click on the tab.
I found the class who create the content : app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php and the function : _prepareLayout().
For “Custom Options” tab you got something like that :
$this->addTab('customer_options', array(
'label' => Mage::helper('catalog')->__('Custom Options'),
'url' => $this->getUrl('*/*/options', array('_current' => true)),
'class' => 'ajax',
));
And for the autoloaded tab content you got :
$this->addTab('group_'.$group->getId(), array(
'label' => Mage::helper('catalog')->__($group->getAttributeGroupName()),
'content' => $this->_translateHtml($this->getLayout()->createBlock($this->getAttributeTabBlock(),
'adminhtml.catalog.product.edit.tab.attributes')->setGroup($group)
->setGroupAttributes($attributes)
->toHtml()),
));
I don’t figure how to use the addTab function with “content”, not “url” and “class” for the “Custom Options” tab.
Does anyone already deal with that ?
Thanks a lot !
With the help of Magento Community I found that :
Works like a charm.
Cheers.