Magento 1.9 Layout – Custom Block on Success Page for Payment Method

blockslayoutmagento-1.9payment-methods

I'm developing a custom payment method and I'd like it to show some info (related to the payment method) on the success page.

How can I do this?

I've tried appending the block to the checkout_onepage_success content but I got nothing but errors.

<checkout_onepage_success translate="label">
    <reference name="content">
        <reference name="checkout.success">
            <action method="setChild">
                <block type="checkbuy/success" name="checkbuy.success" template="checkbuy/success.phtml" />
            </action>
        </reference>
    </reference>
</checkout_onepage_success>

EDIT:
I also tried using <action method="append"> but it caused big PHP errors.

EDIT 2:
I need the block only to be shown when my payment method is selected, I don't want to override the standard success page if the client uses other payment method.

Best Answer

Pleas try this:

<checkout_onepage_success translate="label">
    <reference name="content">
        <reference name="checkout.success">
                <block type="checkbuy/success" name="checkbuy.success" template="checkbuy/success.phtml" />
        </reference>
    </reference>
</checkout_onepage_success>

Then on succcess.phtml call this child block by

<?php echo $this->getChildHtml(checkbuy.success) ;?>
Related Topic