I want to add an Import button and a file browse button next to the Add Product button in the product grid page in magento admin.
When the user choose a file and clicks the Import button
I’ll upload the file to var/import, open a new tab and run the import profile.
How can I add the form (import button + file browse field) to the top of the grid?
Thanks
Use XML Layouts to set your custom template for product grid container block and add your custom form block there. You need to extend
adminhtml_catalog_product_indexlayout handle for that:Then you need to define your block and template. Your custom block should be extended from
Mage_Adminhtml_Block_Widget_Formand template should be a copy ofadminhtml/default/default/template/catalog/product.phtmlbut with modifications to display your custom block, like in the following example: