1

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

3

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.

| improve this answer | |
  • thank you.In our custom module we have cofig.xml of sales.So i need to add visible on frontend in that.Right? – Vishal Feb 26 '14 at 22:59
  • That is correct, modify the visible on frontend value for the order state that Transfer WMS corresponds to. – philwinkle Feb 26 '14 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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