In attempting to avoid rewriting the Mage_Checkout_Block_Onepage_Shipping_Method_Additional
block, I've been following my current strategy of removing the block with the old class and adding a new one with my new class:
<checkout_onepage_shippingmethod>
<remove name="root" />
<block type="my_checkout/onepage_shipping_method_additional" name="my.root" as="root" output="toHtml" template="checkout/onepage/shipping_method/available.phtml" />
</checkout_onepage_shippingmethod>
This works great for non-root blocks, but my alias technique doesn't seem to work in this case. Any ideas?
PS: I'm aware that this can be done with a rewrite.
Best Answer
I can't believe, this is working.
<remove>
is the last statement processed beforetoHtml
. This means, there is NO WAY to have a block with the name root when you remove it.Bu you can just change the type of
root
by overriding the block, like in<checkout_onepage_shippingmethod>
in/app/design/frontend/base/default/layout/checkout.xml:373
It is totally great, that you avoid rewrites!