I need to call a custom block on success page
I have tried by layout as mention below
<checkout_onepage_success translate="label">
<reference name="content">
<block type="checkout/onepage_success" name="checkout.success" template="checkout/success.phtml" >
<block type="core/template" name="birthday" template="checkout/message/birthday.phtml"/>
</block>
</reference>
</checkout_onepage_success>
In success page
echo $this->getChildHtml('birthday');
I am getting birthday block twice on the page.
Please let me know how we can call custom block on success page.
I don't want to use dynamic block i.e.
echo $this->getLayout()->createBlock('core/template')
->setTemplate('checkout/message/birthday.phtml')->toHtml();
Best Answer
Added an answer for you here.
Here it is again:
You are getting the
birthday
block twice because of this line from success.phtml:This line renders all child blocks of the main block.
If you want it listed only once remove the line
It will be redered by the
getChildHtml
method anyway.