Фактически, узел в вашем файле config.xml не выполняет "обновление".
На самом деле, я думаю, что вы сделали это в своем config.xml:
<config>
<frontend>
<layout>
<updates>
<checkout>
<file>mylayout.xml</file>
</checkout>
</updates>
</layout>
</frontend>
</config>
, и вы сделали свои изменения в mylayout.xml.
На самом деле, вы должны сделать:
<config>
<frontend>
<layout>
<updates>
<mymodule>
<file>mylayout.xml</file>
</mymodule>
</updates>
</layout>
</frontend>
</config>
А затем в mylayout.xml:
<checkout_cart_index> <!-- this corresponds to the section where you want to add your block (or modify an existing block -->
<reference name="content">
<reference name="checkout.cart">
<block type="mymodule/myblock" name="checkout.mymodule.myblock"></block>
</reference>
</reference>
</checkout_cart_index>
Глядя на мой код и сравнивая файлы друг с другом, вы лучше поймете, как он работает.
На самом деле, не забывайте, что все xml-файлы объединяются в magento.
Таким образом, все узлы во всех конфигурационных файлах, соблюдая один и тот же порядок, будут объединены.
Например, в нашем случае файлы config.xml magento будут объединены, и в результате получится ОДИН файл, содержащий:
<config>
<!-- some nodes... -->
<!-- some nodes... -->
<!-- some nodes... -->
<frontend>
<layout>
<updates>
<mymodule>
<file>mylayout.xml</file>
</mymodule>
<checkout> <!-- this is the node from the config.xml of the Checkout Module-->
<file>checkout.xml</file>
</checkout>
<!-- some layout updates nodes from other config files... -->
</updates>
</layout>
</frontend>
<!-- some nodes... -->
<!-- some nodes... -->
</config>
Если бы вы заменили <mymodule>
на <checkout>
, результирующий файл выглядел бы так:
<config>
<!-- some nodes... -->
<!-- some nodes... -->
<!-- some nodes... -->
<frontend>
<layout>
<updates>
<checkout>
<file>mylayout.xml</file>
</checkout>
<!-- some layout updates nodes from other config files... -->
</updates>
</layout>
</frontend>
<!-- some nodes... -->
<!-- some nodes... -->
</config>
Обратите внимание на mylayout.xml.
По этой причине исходный файл макета полностью заменен вашим собственным макетом:)
Надеюсь, это понятно, на французском мне было бы легче объяснить;)
Хьюг.