致命错误:未定义的类常量'STATE_PENDING'MAGENTO

时间:2016-03-28 21:22:04

标签: php magento magento-1.9

我有这段代码

$updateOrder->setState(Mage_Sales_Model_Order::STATE_PENDING, true);
$updateOrder->save();

错误是

Fatal error: Undefined class constant 'STATE_PENDING' in

2 个答案:

答案 0 :(得分:1)

STATE_PENDING课程中没有常数Mage_Sales_Model_Order。它是STATE_PENDING_PAYMENT

将您的代码更改为:

$updateOrder->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT, true);

答案 1 :(得分:0)

班级没有待定状态。我想你可以使用STATE_PENDING_PAYMENT

const STATE_NEW             = 'new';
const STATE_PENDING_PAYMENT = 'pending_payment';
const STATE_PROCESSING      = 'processing';
const STATE_COMPLETE        = 'complete';
const STATE_CLOSED          = 'closed';
const STATE_CANCELED        = 'canceled';
const STATE_HOLDED          = 'holded';
const STATE_PAYMENT_REVIEW  = 'payment_review';