1

I'd like to add an iframe to the product tab for every magento product. I am building a magento plugin that allows users to integrate magento with our own analytics control panel, and it would be great if they could click a tab within the product information admin backend on a per product basis to preview the performance of that product.

I have been reading similar questions on the Magento stack exchange but have failed to find something that can answer this question. I essentially just need to know what search times to use to find the answers.

From what I can tell it might involve using the Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Main class. I can't really work out whether I need to add something to my config.xml to get that class working or where to start with this.

A kick in the right direction here would be very helpful.

enter image description here

1

3 Answers 3

1

So to add a tab without rewriting a core file I would suggest using the event core_block_abstract_to_html_before. This event will give you the block as an object so you can check to make sure that it is type Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs, which is where the tabs are created.

$block = $observer->getBlock();
if ($block instanceof Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs) {
    // Code to add tab should go here
}

Then to add a tab you simply need to call the function addTab which takes an id for the tab, a label and the content. So to add another tab that display the inventory details again simply call:

$block->addTab(
    'new_tab',
    array(
        'label'     => Mage::helper('catalog')->__('Inventory'),
        'content'   => Mage::app()->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_inventory')->toHtml()
    )
);

Obviously to display your own custom tab replace the call to adminhtml/catalog_product_edit_tab_inventory with the call to your block.

0

Hope, these links will be useful:

1
  • link only answers are not very good as the links can die over time. Could you summarize each approach please. Dec 3, 2014 at 10:59
0

Default of magento v2, product details page just showing 3 tabs are: Details, More Information and Reviews. With Product Tabs admin can add unlimited tabs. The tab can be use static blocks or attributes. - See more at: http://www.magesolution.com/product-tabs-for-magento-2.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.