Stuck on this for a long now :( I am trying to override a core template file
app/design/frontend/base/default/template/persistent/checkout/onepage/billing.phtml
using custom module which I have successfully activated and the config file for my new module is located at
app/code/local/CustomCheckout/Checkout/etc/config.xml.
Below are the content
<config>
<modules>
<CustomCheckout_Checkout>
<version>1.0.0</version>
</CustomCheckout_Checkout>
</modules>
<frontend>
<routers>
<checkout>
<args>
<modules>
<CustomCheckout_Checkout before="Mage_Checkout">CustomCheckout_Checkout</CustomCheckout_Checkout>
</modules>
</args>
</checkout>
</routers>
<layout>
<updates>
<checkout>
<file>persistent.xml</file>
</checkout>
</updates>
</layout>
</frontend>
</config>
I am trying to override the persistent.xml layout which in turn calls the said billing.phtml file. I placed the new layout file at following location
app/design/frontend/default/CustomCheckout/layout/persistent.xml.
Below are the content
<layout version="0.1.0">
<checkout_onepage_index>
<reference name="checkout.onepage.billing">
<action method="setTemplate">
<template>checkout/onepage/billing.phtml</template>
</action>
</reference>
</checkout_onepage_index>
</layout>
I have placed my modified billing.phtml file under
app/design/frontend/default/CustomCheckout/template/checkout/onepage/billing.phtml
but it is not being picked up. I am scratching my head...any help is appreciated.
I am magento developer. I did implement your problem at localhost & find solution. I just create kinex/links (namespace/module). In this module layout file contain the following code:
This is very Simple, You can simply write the xml as:
If there is some error in checkout page, then it means billing or shipping.phtml file is missing.
Hopefully you've found an answer by now, but for posterity...
The issue here is that the "Persistent" module is already overriding that template. If you look in the persistent.xml layout file you see the following:
Magento's default loading order is alphabetical. So, since the Persistent module is "Mage_Persistent" and your module is "CustomCheckout_Checkout", the Persistent module is loaded last, and it's override is the one that sticks.
There are several solutions. One is to rename your module so that it's after Mage_Persistent in the alphabet.
A better solution is to use Magento's dependency functionality. In your module declaration file (app/etc/modules/CustomCheckout_Checkout.xml), you probably have something like this:
Modify this as shown here:
This indicates to Magento that your module "depends" on Mage_Persistent and should therefore be loaded after it.
If that does not work for you, another technique would be to use a "remove" node in your layout xml to get rid of the original billing block:
Then re-add it with a different name, as it is in checkout.xml. Make sure to add all necessary blocks and actions underneath it from various layout files and use the same alias (as="billing").
Finally, if this module is not intended for re-use (the change is just for your current install) you could simply copy the phtml file into the same path in your custom package/theme folder.