Magento后台手动修改订单状态方法及手动修改方法php

订单详细内容页手动修改订单状态方法:

打开此文件:appdesignadminhtmldefaultdefault emplatesalesorderviewhistory.phtml

34行位置为如下原本内容:

            <?php foreach ($this->getStatuses() as $_code=>$_label): ?>

修改为:

            <?php foreach (Mage::getSingleton('sales/order_config')->getStatuses() as $_code=>$_label): ?>

刷新缓存,然后刷新订单页面看看,在订单页面的Comments History部分就可以更改订单状态了。

手动用php文件修改方法:

在网站跟目录下新建一个php文件

<?php

require_once('app/Mage.php');
umask(0);
Mage::app('default');

$order = Mage::getModel('sales/order');
$order->loadByIncrementId(100000001);  // 100000001为订单编号

// 获取订单状态
$status = $order->getStatus();
$state  = $order->getState();

echo $status;
echo " ";
echo $state;

// 设置订单状态
$order->setStatus(Mage_Sales_Model_Order::STATE_PROCESSING);
$order->save();

?>

原文地址:https://www.cnblogs.com/focai/p/4778562.html