Pergunta

Magento version 1.9

I want to create a copy of manage product in a new menu in magento admin. I created the menu and i am struck with copying the product view grid and rest of the thing.Can any one help me please to achieve this task.

My config.xml file

<config>  
<modules> 
    <Eight25media_Tproducts> 
        <version>0.1.0</version>
    </Eight25media_Tproducts>
</modules>
<global>
    <helpers>
        <tproducts>
            <class>Eight25media_Tproducts_Helper</class>
        </tproducts>
    </helpers>
</global>
<admin>
    <routers>
        <adminhtml>             
            <args>
                <modules>
                    <tproducts>Eight25media_Tproducts_Adminhtml</tproducts>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

My adminhtml.xml file

<config>  
<menu>
    <tproducts translate="title" module="tproducts">
        <title>Products - Training</title>
        <sort_order>100</sort_order>
        <children>
            <manage_tproducts>
                <title>Manage Products(Training) </title>
                <sort_order>1</sort_order>
                <action>adminhtml/catalog_product/</action>
            </manage_tproducts>
        </children>
    </tproducts>
</menu>

For now, i just called the catalog_product link. But i want to call in my own frontend name.

How can i implement this?

Foi útil?

Solução

you are missing after="Mage_Adminhtml" in config.xml

<admin>
    <routers>
        <adminhtml>             
            <args>
                <modules>
                    <tproducts after="Mage_Adminhtml">Eight25media_Tproducts_Adminhtml</tproducts>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

then simply call the <action>adminhtml/controllername_actionname/</action>

simply extends your grid block with all grid will be loaded

 class Eight25media_Tproducts_Block_Adminhtml_Tproducts_Grid extends Mage_Adminhtml_Block_Catalog_Product_Grid 
{


}

now all the action will goes to your controller

you want to just add the block nothing to change just add this xml in your layout

<reference name="content">
            <block type="adminhtml/catalog_product" name="products_list">
                <block type="adminhtml/store_switcher" name="store_switcher" as="store_switcher">
                    <action method="setUseConfirm"><params>0</params></action>
                </block>
            </block>
        </reference> 
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top