Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
How to add access to order history on the top links as “My Orders”
 
coolshop
Sr. Member
 
Total Posts:  121
Joined:  2009-08-28
 

OK I did spend way too many hours to try to figure this one out.
I want to add a link to the top link to access the order history screen.
I got it working somewhat but if I click on any other toplink link, the url path get screwed up.

Here is what I did:
I modified the customer.xml layout in my template by adding the following

<default>
    <!-- 
Mage_Sales -->
    <
reference name="top.links">
        <
action method="addLink" translate="label" module="customer"><label>My Orders</label><url helper="customer/getAccountUrl"/><title>My Orders</title><prepare/><urlParams/><position>10</position></action>
    </
reference>
    <
customer_account>
        <
action module="sales"><name>My orders</name><path>sales/order/history/</path><label>My Orders</label></action>
    </
customer_account>

    <
sales_order_history>
        <
update handle="customer_account"/>
        <
reference name="content">
            <
block type="sales/order_history" name="sales.order.history"/>
            <
block type="customer/account_dashboard" name="customer.account.link.back" template="customer/account/link/back.phtml"/>
        </
reference>
    </
sales_order_history>
</default>

I got most of the hint from in the layout file sales.xml.

Can any body brings some light to this simple change I am trying to do?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cubix Web Solutions
Guru
 
Avatar
Total Posts:  311
Joined:  2009-07-01
LondON, United Kingdom
 

Typing this for the third time because of my stupid browser!

Anyways, put the following code between <default></default>.

<reference name="top.links">
        <
action method="addLink" translate="label" module="customer"><label>My Orders</label><url>sales/order/history</url><title>My Orders</title><prepare/><urlParams/><position>10</position></action>
    </
reference>

This will take logged in customers directly to the order history page. For anonymous users it will take to the log in page and then on successfully login will take directly to their order history page..

If you want the link to show only for customer that are logged in then put the code between <customer_logged_in></customer_logged_in> instead of <default></default>

Although I just tried and tested this for you, let me know if it works or not.

 Signature 

Cubix Web Solutions
Affordable Magento Solutions
Contact Us

For Magento, don’t ask us “Can you..” . Ask “How quick can you..”

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
704132 users|1744 users currently online|497364 forum posts