Magento的pending订单在用户账户中不显示的解决办法

来源:互联网 发布:xps 转换 知乎 编辑:程序博客网 时间:2024/06/06 06:33

magento1.4以前的版本,在用户的My Dashboard不现里显示,但是这个不能满足客户的需求,所以要解决这个问题。
首先我通过ftp进入网站,通过查看相关模板我找到了订单处理的类,在文件/app/code/core/Mage/Sales/Block/Recent.php里,在文件里有一段代码
parent::__construct();

        //TODO: add full name logic
        $orders = Mage::getResourceModel('sales/order_collection')
            ->addAttributeToSelect('*')
            ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
            ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
            ->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
            ->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
            ->addAttributeToSort('created_at', 'desc')
            ->setPageSize('5')
            ->load()
        ;

        $this->setOrders($orders);
    }
我注释掉了一条语句“->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()));
,检测在前台显示出了pending状态的订单