2

What I need to do is to change the template on block named "tax" of type "tax/sales_order_tax" on all places where it appears exclude the admin, using custom module. The problem is that I cant make it change the template for the email elsewhere it is changed as expected.

That is what I have at the moment done:

My module depends on the following modules not only for that reason but as it has more functionality in it. It is configured in the local code pool.

<depends>
    <Mage_Adminhtml/>
    <Mage_Catalog/>
    <Mage_Tax/>
    <Mage_Customer/>
    <Mage_Sales/>
</depends>

It has configured custom frontend layout file, with the following content:

<?xml version="1.0"?>
<layout version="0.1.0">
    <change_tax_template>
        <reference name="tax">
            <action method="setTemplate"><template>Company/Modifier/tax/order/tax.phtml</template></action>
        </reference>
    </change_tax_template>

    <sales_order_view>
        <update handle="change_tax_template"/>
    </sales_order_view>

    <sales_order_invoice>
        <update handle="change_tax_template"/>
    </sales_order_invoice>

    <sales_order_creditmemo>
        <update handle="change_tax_template"/>
    </sales_order_creditmemo>

    <sales_order_print>
        <update handle="change_tax_template"/>
    </sales_order_print>

    <sales_order_printinvoice>
        <update handle="change_tax_template"/>
    </sales_order_printinvoice>

    <sales_order_printcreditmemo>
        <update handle="change_tax_template"/>
    </sales_order_printcreditmemo>

    <sales_email_order_items>
        <update handle="change_tax_template"/>
    </sales_email_order_items>

    <sales_email_order_invoice_items>
        <update handle="change_tax_template"/>
    </sales_email_order_invoice_items>

    <sales_email_order_creditmemo_items>
        <update handle="change_tax_template"/>
    </sales_email_order_creditmemo_items>

    <sales_guest_view>
        <update handle="change_tax_template"/>
    </sales_guest_view>

    <sales_guest_invoice>
        <update handle="change_tax_template"/>
    </sales_guest_invoice>

    <sales_guest_creditmemo>
        <update handle="change_tax_template"/>
    </sales_guest_creditmemo>

    <sales_guest_print>
        <update handle="change_tax_template"/>
    </sales_guest_print>

    <sales_guest_printinvoice>
        <update handle="change_tax_template"/>
    </sales_guest_printinvoice>

    <sales_guest_printcreditmemo>
        <update handle="change_tax_template"/>
    </sales_guest_printcreditmemo>
</layout>

I will not post the configuration for this layout file as I know it is working because the template for the "tax" block is changed as it supposed everywhere except in the emails and exactly for the new order email for sure.

I cant figure out why the template is not changing for the new order template but is for the whole frontend of the website.

If you need more information about the configurations or code of the module to figure out what may be wrong, please ask.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.