Magento – Insert Custom Block in Payment Method Page

onepage-checkoutpayment

I want to include my custom HTML block in One Page Checkout.

The block will display some additional details about the payment methods and it will be showed under Payment Information tab. Just like info.phtml, I want to include my phtml file too.

In my mymodule.xml, I've tried including like below but no luck.

<checkout_onepage_index>
        <reference name="checkout.onepage.payment">
            <block type="core/template" name="customer_mymodule_checkout" as="mymodule_checkout" after="methods" template="mymodule/checkout/onepage/payment/mymodule.phtml" />
        </reference>
    </checkout_onepage_index>

How can I achieve this ?

Thanks.

Best Answer

You need to add the block in the layout AND get it's content in the .phtml file using code

echo $this->getChildHtml('yourblock')

It's confusing, because magento has several types of blocks.

One is list type, like 'content' and it just outputs all children blocks.

And one is 'template', it outputs it's phtml template and requires from us to define a place in this template where we want to see the inner blocks.

Related Topic