1

I am adding a custom field to customer account dashboard and here I want to display the order as it is displaying on the my order thing and I have to add some buttons and a submit form. So my question is how I will get the layout of my orders for my custom filed.

I have added custom field using this link go the link and check the process.

2 Answers 2

2

You should use the same layout, blocks and templates as for sales_order_history:

<sales_order_history translate="label">
    <label>Customer My Account Order History</label>
    <update handle="customer_account"/>
    <reference name="my.account.wrapper">
        <block type="sales/order_history" name="sales.order.history">
            <block type="core/text_list" name="sales.order.history.info" as="info" translate="label">
                <label>Order History Info</label>
            </block>
        </block>
        <block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
    </reference>
</sales_order_history>

In your case the tag </sales_order_history> should be replaced with your controller and action names. The user achieving them, when following the appropriate link. Then, you can study what blocks you want to change and how to replace them by your own, while inheriting the appropriate Magento blocks. Perhaps, for your needs will be enough to add your own templates for these blocks without changing them. Anywise, the less you change – the better it works. All changes have to be applied in your own module, and directives should be added to its layout.

0

You should use/copy existing default magento template file (.phtml) and replace data with your custom fields.

Keep HTML element with classes as is, just change IDs of tables and in javascripts if used.

If you want same My Order customer dashboard layout then you should start with orders.phtml (located here: \app\design\frontend\base\default\template\customer\orders.phtml)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.