After overriding contoller how to best update handles
Once i override controller:
<!--...-->
<rewrite>
<sj_storepickup_checkout_onepage>
<from><![CDATA[#^/checkout/onepage/#]]></from>
<to>/storepickup/checkout_onepage/</to>
</sj_storepickup_checkout_onepage>
</rewrite>
<!--...-->
I am forced(because i don't know other way) to include layout file:
<!--...->
<layout>
<updates>
<storepickup>
<file>storepickup.xml</file>
</storepickup>
</updates>
</layout>
<--...-->
so that i can update the new module(this case storepickup) handles to use orginal checkout_onepage_action handles that would be done as following in storepickup.xml
<sj_storepickup_checkout_onepage_index>
<update handle="checkout_onepage_index"/>
</sj_storepickup_checkout_onepage_index>
<sj_storepickup_checkout_onepage_progress>
<update handle="checkout_onepage_progress"/>
开发者_JAVA技巧 </sj_storepickup_checkout_onepage_progress>
.
.
.
Otherwise the layout will render empty content block.
In the layout file storepickup.xml i am saying to use the original checkout layout handles and this seems a lot of repetitiveness and inefficient way to do it? Is there better way to update the handles? can i do the same thing within controller that way avoiding extra layout file to write/process?
Thank you,
Margots
Overriding controllers directly was always a bit of hack, with a lot of undesired side effects. Try using the technique discussed here to have Magento check your module first for a particular controller file.
<admin>
<routers>
<adminhtml>
<args>
<modules>
<sintax before="Mage_Adminhtml">Mage_Sintax</sintax>
</modules>
</args>
</adminhtml>
</routers>
</admin>
It should leave your handle names intact.
Thanks Alan,...I did tried this before posting just to learn that Magento version 1.2 does not support this solution and the site is in version 1.2. I believe this solution will only work for magento version 1.3 and above. please, correct me if i am wrong?
Any other ideas how to solve this in magento version 1.2 and below?
精彩评论