更新时间:2023-11-30 08:18:04
在Mage_Sales_Model_Order_Status_History
中,如果提供参数null
或常量Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE
的值,则可以看到setIsCustomerNotified
方法禁止显示通知. .令人困惑的是,使用false
会导致发送通知.
In Mage_Sales_Model_Order_Status_History
, you can see that the setIsCustomerNotified
method suppresses notification if you provide either parameter null
or the value of the constant Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE
. Confusingly, using false
will lead to the notification being sent.
此代码块有效-修改订单状态,添加仅在后端可见且不会触发向客户端的通知电子邮件的注释:
This code block works - revise order status, adding a comment that is visible only on the backend and will not trigger a notification e-mail to the client:
$historyItem = $order->addStatusHistoryComment('some comment', 'complete');
$historyItem->setIsVisibleOnFront(false);
$historyItem->setIsCustomerNotified(Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE);
$historyItem->save();
$order->save();