1

I have a problem with loading a new template on payment methods section on checkout, but only on my custom theme. I have created a custom module that adds a new block with template in the above section.

My layout.xml is:

<layout version="0.1.0">
    <checkout_onepage_index>
        <reference name="checkout.onepage.payment">
            <block type="core/text_list" name="checkout.payment.methods.additional" as="methods_additional">
                <block type="core/template" name="cardcadou" template="cardcadou/cardcadou.phtml"/>
            </block>
        </reference>
    </checkout_onepage_index>
</layout>

The problem is that I tested on rwd theme and the template is displayed correctly, but on my custom theme it is not displayed at all.

I've checked if the layout.xml is called by adding this code under the <checkout_onepage_index>:

<reference name="head">
    <action method="addJs">
        <script>test/test.js</script>
    </action>
</reference>

And I looked in my page source and the js file is loaded, so the layout.xml is called.

What am I doing wrong here?

0
  1. app/design/frontend/{currentTheme}/{themeName}/layout/local.xml
<checkout_onepage_index>
    <reference name="root">
        <block type="core/template" name="my.cardcadou" template="cardcadou/cardcadou.phtml"/>
    </reference>
</checkout_onepage_index>
  1. app/design/frontend/{currentTheme}/{themeName}/template/cardcadou/cardcadou.phtml
Your code goes here
  1. app/design/frontend/{currentTheme}/{themeName}/template/checkout/onepage/payment.phtml
<?php echo $this->getBlockHtml('my.cardcadou'); ?>

Good luck.

  • So, there is no way to do this without editing one of the files from my custom theme even if in the rwd theme it's working without editing any file? Like you did at point 3... – Ciprian Dec 18 '18 at 15:21
  • Basically there is a way to do it only via xml, but I don't know your code, maybe this block it's removed in your current theme for exemple or ..., this is why I used this solution. it's works and there is no problem with that since you don't update the magento core files – PЯINCƏ Dec 18 '18 at 15:33
  • It is a problem if the module is made to be used on more than one theme, because you have to modify in every single one...I didn't find any line in xml that removes my block... – Ciprian Dec 18 '18 at 15:43
  • I understand, try your xml without the structural block – PЯINCƏ Dec 18 '18 at 15:56
-3

May I know your template files folder location.?.

Then Goto Admin section,

  • Navigate to System -> Configuration in your admin panel.
  • Select your Store.
  • Now you should navigate to System -> Configuration -> Design
  • Check the "Package Name and Theme Name".
  • Change it according to Your Package and theme name.
  • Save and Clear Cache.

Check the changes now.

  • First the template file location was frontend/base/default/template/cardcadou/cardcadou.phtml then I tried with frontend/myFolderTheme/default/template/cardcadou/cardcadou.phtml but none of the cases worked – Ciprian Dec 18 '18 at 11:56
  • I'm not sure why are you telling me this, because I already write in my question that I test on my theme and on rwd theme, on rwd it is working but on my theme is not working... – Ciprian Dec 18 '18 at 13:10

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.