Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Comment faire un rewrite d’un controllers (admin) avec Magento 1.4.1.1
 
DavidMagentoTypo3
Jr. Member
 
Total Posts:  3
Joined:  2010-12-09
 

Ma version :Magento 1.4.1.1

J’essaie désespérément de faire un rewrite d’un controllers (admin), actuellement rien de fonctionne, Magento ne prend pas en charge mon config.xml

Voici la source que je souhaite surcharger:
community/MDN/Purchase/controllers/SupplyNeedsController.php
Content:

<?php
class MDN_Purchase_SupplyNeedsController extends Mage_Adminhtml_Controller_Action { ... }

Voici mon module:
local/MyNameSpace/Purchase/controllers/SupplyNeedsController.php
local/MyNameSpace/Purchase/etc/config.xml

MyNameSpace_Purchase.xml :

<?xml version="1.0"?>
<config>
    <
modules>
        <
MyNameSpace_Purchase>
            <
active>true</active>
            <
codePool>local</codePool>
        </
MyNameSpace_Purchase>
    </
modules>
</
config>

Mon config.xml:

<?xml version="1.0"?>
<config>
    <
modules>
        <
MyNameSpace_Purchase>
        <
version>1.0.0</version>
        </
MyNameSpace_Purchase>
    </
modules>
    <
admin>
       <
routers>
           <
purchase>
               <use>
admin</use>
                     <
args>
                         <
module>MyNameSpace_Purchase</module>
                         <
frontName>purchase</frontName>
                     </
args>
            </
purchase>
       </
routers>
    </
admin>
</
config>

Mon fichier local/MyNameSpace/Purchase/controllers/SupplyNeedsController.php :

<?php
require_once 'MDN/Purchase/controllers/SupplyNeedsController.php';
class 
MyNameSpace_Purchase_SupplyNeedsController extends MDN_Purchase_SupplyNeedsController {
    
/**
     * Override app\code\community\MDN\Purchase\controllers\SupplyNeedsController.php
     * Create a purchase order and add products and redirect to Orders\List
     *
      * @return     void
     */    
    
public function CreatePurchaseOrderAction() {
        
// Init needed vars        
....
    
}
etc
...
}

Qu’est-ce qui manque ou n’est pas bon dans ma config?
Merci d’avance.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top