Magento Catalog ProductController rewrite

后端 未结 1 1248
-上瘾入骨i
-上瘾入骨i 2021-01-24 18:36

I try to override the magento Mage\\Catalog\\controllers\\ProductController.php with a module. In my module i try this:

\\etc\\config.xml


         


        
1条回答
  •  不知归路
    2021-01-24 19:02

    you can use like below

    Edit you Package/Module/etc/config.xml

    
    
    ... Your Other config here ....
        
             
               
                  
                  
                    Package_Catalog
                  
                  
              
            
        
    
    

    Now your controller already ready.

    include(Mage::getBaseDir()."/app/code/core/Mage/Catalog/controllers/ProductController.php");
    class Package_Catalog_ProductController extends Mage_Catalog_ProductController
    {
          public function viewAction(){
                 echo __METHOD__;
          }
    }
    ?>
    

    0 讨论(0)
提交回复
热议问题