config.xmlからレイアウトを呼び出すことはできません
あなたは次のように言っています:私はonepage.xmlのコードを変更します->あなたが意味したのはcheckout.xmlのようですこれは定義の用語です。モジュールの定義が異なる場合があります。
app/code/local/[Mynamespace]/[Mymodule]
あなた[Mymodule]
が呼び出しているモジュールがあるとしましょうあなたはmymodule.xml
それがあなたのモジュールから呼び出されていると言いますか?
1)はいの場合、このコードをconfig.xml
<config>
<modules>
<Mynamespace_Mymodule>
<version>1.0</version>
</Mynamespace_Mymodule>
</modules>
<frontend>
<layout>
<updates>
<mymodule>
<file>mymodule.xml</file>
</mymodule>
</updates>
</layout>
</frontend>
</config>
そのコードはという名前のレイアウトを呼び出しますmymodule.xml
次に、でレイアウトファイルを作成しますapp/design/frontend/[base/default]/[default/yourtheme]/layout/mymodule.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<checkout_onepage_index>
<reference name="checkout.onepage">
<action method="setTemplate"><template>mynamespace/mymodule/onepage.phtml</template></action>
</reference>
</checkout_onepage_index>
</layout>
2)いいえ->モジュールの定義がの下のファイルのみである場合はapp/code/local/[Mynamespace]/[Mymodule]
、Onepageのブロックを書き直す必要があります
config.xml
<config>
<modules>
<Mynamespace_Mymodule>
<version>1.0</version>
</Mynamespace_Mymodule>
</modules>
<global>
<blocks>
<checkout>
<rewrite>
<onepage>Mynamespace_Mymodule_Block_Checkout_Onepage</onepage>
</rewrite>
</checkout>
</blocks>
</global>
</config>
その構成を使用するMage_Checkout_Block_Onepage
と、によって書き換えられMynamespace_Mymodule_Block_Checkout_Onepage
ます(ディレクトリ構造が一致している限り、名前を変更できます)。
たとえば、ファイルは次の場所に配置されます。app/code/local/[Mynamespace]/[Mymodule]/Block/Checkout/Onepage.php
最後にあなたapp/code/local/[Mynamespace]/[Mymodule]/Block/Checkout/Onepage.php
はこのようになります:
class Mynamespace_Mymodule_Block_Checkout_Onepage extends Mage_Checkout_Block_Onepage
{
public function __construct()
{
parent::__construct();
$this->setTemplate('mynamespace/mymodule/onepage.phtml');
}
}