1

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.

  • Every thing looks good have you tried with flushing cache, one more thing check if compiler enable disable that. – Aman Alam Jul 16 '17 at 14:56
  • I systematically flush or purge the cache, and compiler isn't enabled. – Grymas Jul 16 '17 at 15:03
  • Try to push your template and layout file in base/default and let me know. – Aman Alam Jul 16 '17 at 15:12
  • Same error, Invalid method Mage_Checkout_Block_Onepage_Payment, I removed every layout and template and only put them in base/default. – Grymas Jul 16 '17 at 19:17
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.