Question

I'm trying to override the 'payment' step of the magento onepage checkout. I've managed to do this before with the 'billing' step, but this isn't working, and i'm kinda confused as to why. Layouts and template confuse me in general, they're not exactly crystal clear in my head.

My custom package/theme is a copy of RWD.

I have my custom module working, the layout file is declared in the config :

<frontend>
    <layout>
        <updates>
            <mymodule>
                <file>mymodule.xml</file>
            </mymodule>
        </updates>
    </layout>
</frontend>

I'm not sure where the best place to put this layout file is, but I've tried in base or in my current package/theme

Then in this layout file, there's this :

<checkout_onepage_index translate="label">
    <reference name="head">
        <action method="addCss"><stylesheet>mymodule/css/mymodule.css</stylesheet></action>
    </reference>
    <reference name="checkout.onepage.payment">
        <action mathod="setTemplate">
            <template>mymodule/checkout/onepage/payment.phtml</template>
        </action>
    </reference>
</checkout_onepage_index>

In my current package/theme, there's a 'mymodule' folder in templates with the folder structure described above (mymodule/checkout/onepage/payment.phtml).

The payment.phtml file is currently empty, i've tried having it be an exact copy of the RWD payment.phtml as well.

I've fiddled with a few things, putting the files in different places, etc.

My problem is that either nothing happens, or I get this report :

a:5:{i:0;s:121:"Invalid method Mage_Checkout_Block_Onepage_Payment::(Array
(
    [0] => mymodule/checkout/onepage/payment.phtml
)
)";i:1;s:2159:"#0 [internal function]: Varien_Object->__call('', Array)

I'd really appreciate a solution, because I'm fairly confused about the whole custom theme + layout + templates and how i'm supposed to properly override them with a module.

Was it helpful?

Solution

Turns out it was a typo, "mathod" instead of "method". The error I thought meant it couldn't find the template I was giving it, but it was just Magento not being able to read the layout file and not understanding "mathod".

Since my themes are children of RWD, I put this custom layout and the template file in RWD, I copied the content of the default RWD payment.phtml file into mine and added my custom stuff.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top