Magento: How to Override View Template
I want to display the order invoice page with a custom theme but I don't want to rewrite all of the app code associated with it (blocks, helpers, etc). Here's how it should work from a user point-of-view:
- User goes to a custom "Order History" page with URL "../custom-account/orders/".
- They click on the "View Invoices" link in the order history list which takes them to "../custom-account/orders/invoic开发者_如何学Pythones/order_id/1".
- The page loads the custom view with almost exactly the same content as "../sales/account/view/order_id/1" - but with a different look and feel (and navigation).
With the flexibility of the Magento system, this seems like something that should be really easy to achieve but I can't figure out exactly what I need to do. I really don't want to go overriding all of the various blocks and models with exactly the same functionality just to get a different UI.
Any ideas?
Thanks for any help provided...
I don't know if u have figured out this yet or not. But hope this solution will help. Like u said ur using fontend/default/default/templates, u need to create a folder of same structure of the base/default/template & copy paste the files that u want to rewrite into this folder. DO the changes that u want to do. Magento should read this file instead of the base/default/tmeplate
But if ur using a theme already the try to do this thing in ur app/design/frontend/default//templates
if u have a layout problem of 2-col-left & 2-col-right. then I would suggest check it in ur frontend/default/default/layout/sales.xml check for tag then u need to write this code
<reference name="root">
<action method="setTemplate"><template>page/<layout_file_name>.phtml</template></action>
</reference>
Ideally this should run on 2-col-left layout.
Hope this helps & let me know if I helped you
:)SAM
精彩评论