Php Can';t覆盖Magento 1.7.0.2中的签出

Php Can';t覆盖Magento 1.7.0.2中的签出,php,magento,magento-1.7,overriding,checkout,Php,Magento,Magento 1.7,Overriding,Checkout,我似乎无法覆盖Magento中的签出控制器。 我复制了应用程序/code/local/Checkout中的文件夹,但它似乎不起作用 其他人谁只是复制粘贴文件夹似乎得到它的权利。 是否需要执行某些操作?这不是扩展控制器的推荐方法。我假设您要扩展Checkout OnepageController 正确的做法是 1.)确定正确的模块或为此创建新模块 app/code/local/Mel/Gallosa(记住在app/etc/modules中激活模块) 添加文件etc/config.xml和contr

我似乎无法覆盖Magento中的签出控制器。 我复制了
应用程序/code/local/Checkout
中的文件夹,但它似乎不起作用

其他人谁只是复制粘贴文件夹似乎得到它的权利。
是否需要执行某些操作?

这不是扩展控制器的推荐方法。我假设您要扩展Checkout OnepageController

正确的做法是

1.)确定正确的模块或为此创建新模块

app/code/local/Mel/Gallosa(记住在app/etc/modules中激活模块)

添加文件etc/config.xml和controllers/OnepageController.php

您的文件内容将被删除

<?xml version="1.0"?>
<config>
    <modules>
        <Mel_Gallosa>
          <version>0.1.0</version>
        </Mel_Gallosa>
    </modules>
    <frontend>
        <routers>
            <checkout>
                <use>standard</use>
                <args>
                    <modules>
                        <Mel_Gallosa before="Mage_Checkout">Mel_Gallosa</Mel_Gallosa>
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>

0.1.0
标准
梅卢·加洛萨
然后是新的控制器文件

<?php
require_once 'Mage/Checkout/controllers/OnepageController.php';
class Mel_Gallosa_OnepageController extends Mage_Checkout_OnepageController
{
    /*you can now overide any method here. Remember that you want to extend code in an Object Orientated fashion. Call the parent functions when appropriate and at the right time. Only replace methods that you are trying to overwrite. There is no need to dump all methods here. */

  //here is an example

  public function indexAction()
  {
      Mage::log('we have now overwritten the index action',null,'mel.log');

      parent::indexAction(); /* this means that if there are any core updates you will get them too :) */
  }
}