June 9, 2016

Orders do not show up in Your Account > Order History

My customers place orders, and when they go to the Your Account > Order History section of their account, the orders do not show up while admin can see in the back-end.

After investigating I seen that order has been NOT completed payment in payment gateway. So the payment module set the order state is "pending_payment". Looking Mage_Sales module we will see list of order state defined in app/code/core/Mage/Sales/etc/config.xml

<config>
    <global>
        <sales>
            <order>
                <states>
                    <new translate="label">
                        <label>New</label>
                        <statuses>
                            <pending default="1"/>
                        </statuses>
                        <visible_on_front>1</visible_on_front>
                    </new>
                    <pending_payment translate="label">
                        <label>Pending Payment</label>
                        <statuses>
                            <pending_payment default="1"/>
                        </statuses>
                    </pending_payment>
you will notice this state does not have a <visible_on_front>1</visible_on_front> node

So the solution is change order status to processing or allow this state to be shown. For the second option you can use the following: 

<config>
    <global>
        <sales>
            <order>
                <states>
                    <pending_payment translate="label">
                        <visible_on_front>1</visible_on_front>
                    </pending_payment>
                </states>
            </order>
        </sales>
    </global>
</config>
in your own custom extension's etc/config.xml file.
There was an error in this gadget