Question

In my store,When a customer places an order, it appears in the “My Orders” section of their account. However, once the order status is changed to Transfer WMS, the order history no longer appears.

Any help on this?

Thank you

Was it helpful?

Solution

Transfer WMS is not a default status in Magento. This is not a problem, except for the fact that statuses are married to states, and only states that have the option visible_on_front property set to a truthy value will display to a customer.

Here's the block that is responsible for display of recent orders in the dashboard to the customer:

#file: app/code/core/Mage/Sales/Block/Order/History.php
class Mage_Sales_Block_Order_History extends Mage_Core_Block_Template
{

    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('sales/order/history.phtml');

        $orders = Mage::getResourceModel('sales/order_collection')
            ->addFieldToSelect('*')
            ->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
            ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
            ->setOrder('created_at', 'desc')
        ;

        $this->setOrders($orders);

        Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('My Orders'));
    }
    //....snip 
}

The reason this is important is because it's filtering the state out of the view if it is not marked visible. If you are using a custom state you'll have to modify this in the xml definition. Custom states can be added via config xml, and may have been added via a module. You'll have to search for it, and it usually looks like this:

<order>
    <states>
        <new translate="label">
            <label>New</label>
            <statuses>
                <pending default="1"/>
            </statuses>
            <visible_on_front>1</visible_on_front>
        </new>
   </states>
</order>

This particular snippet comes from /app/code/core/Mage/Sales/etc/config.xml. Notice the visible_on_front property - that's your way of controlling whether the customer will see this or not.

Best of luck.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top