Magento - unexpected template being used

458 Views Asked by At

To cater for Magento's (1.7.0.2) omission of discount code in the checkout process (madness!), I installed a small extension to add the same. That works fine, but owing to Magento's limited support for enhancing individual blocks, the extension has provided a whole new checkout/onepage/progress.phtml file which is implemented quite different to the theme (package) supplied progress box. So to deal with that I have to merge the extension one-page progress.phtml with my theme's progress.phtml file and use that instead.

But that's not the question! The question is why is the store now using the extension progress.phtml file instead of my theme's progress.phtml file?

I thought I was getting to grips with Magento's ubercomplex templates, but clearly not! To fix this I need it to revert back to my theme's progress.phtml. To elaborate...

The extension installs into frontend/base/default and includes a layout XML that specifies:

<layout>
    <checkout_onepage_index translate="label">
        <reference name="checkout.onepage">
            <block type="greenacorn_checkoutcoupon/onepage_coupon" name="greenacorn_checkoutcoupon.onepage.coupon" as="coupon" template="greenacorn/checkoutcoupon/onepage/coupon.phtml"/>
        </reference>
        <reference name="checkout.progress">
            <action method='setTemplate'>
                <template>greenacorn/checkoutcoupon/onepage/progress.phtml</template>
            </action>
        </reference>
    </checkout_onepage_index>
    <checkout_onepage_progress>
        <reference name='root'>
            <action method='setTemplate'>
                <template>greenacorn/checkoutcoupon/onepage/progress.phtml</template>
            </action>
        </reference>
    </checkout_onepage_progress>
</layout>

Can anyone explain why the develper has apparently set the progress template twice?

Now my theme has the following specified in frontend/[theme]/default/layout/checkout.xml

<checkout_onepage_progress>
    <!-- Mage_Checkout -->
    <remove name="right"/>
    <remove name="left"/>

    <block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress.phtml">
        <block type="checkout/onepage_payment_info" name="payment_info">
            <action method="setInfoTemplate"><method></method><template></template></action>
        </block>
    </block>
</checkout_onepage_progress>

My understanding is that stuff defined in the configured theme takes precedence over stuff defined in frontend/default which takes precedence over stuff defined in frontend/base. So how is the template defined in the extension taking precedence over the template defined in the theme?

1

There are 1 best solutions below

3
On BEST ANSWER

checkout/index and checkout/progress are two different pages: that's why the developer set both them.

There should be another .xml file (maybe /app/code/community/greenacorn/checkoutcoupon/etc/config.xml) defining layout overwrites, in a node like:

<layout>
    <updates>
        <extensionname>
            <file>developer_extensionname.xml</file>
        </extensionname>
    </updates>
</layout>