magento修改订单状态、添加订单备注代码示例
来源:互联网 发布:网站排名优化查询 编辑:程序博客网 时间:2024/05/29 10:18
magento修改订单状态、添加订单备注代码示例
Order API状态:
Resource Name:sales_order
Aliases:
.order
Methods:
sales_order.list-Retrieve list of orders by fiters
sales_order.info-Retrieve order information
sales_order.addComment-Add comment to order
sales_order.hold-hold order
sales_order.unhold-Unhold order
sales_order.cancel-Cancel order
magento自带函数:
public function addComment($orderIncrementId, $status, $comment = null, $notify = false)
{
$order = $this->_initOrder($orderIncrementId);
$order->addStatusToHistory($status, $comment, $notify);
try {
if ($notify && $comment) {
$oldStore = Mage::getDesign()->getStore();
$oldArea = Mage::getDesign()->getArea();
Mage::getDesign()->setStore($order->getStoreId());
Mage::getDesign()->setArea('frontend');
}
$order->save();
$order->sendOrderUpdateEmail($notify, $comment);
if ($notify && $comment) {
Mage::getDesign()->setStore($oldStore);
Mage::getDesign()->setArea($oldArea);
}
} catch (Mage_Core_Exception $e) {
$this->_fault('status_not_changed', $e->getMessage());
}
return true;
}
Magento addStatusToHistory这个函数可以同时修改订单状态和添加订单备注
Order API状态:
Resource Name:sales_order
Aliases:
.order
Methods:
sales_order.list-Retrieve list of orders by fiters
sales_order.info-Retrieve order information
sales_order.addComment-Add comment to order
sales_order.hold-hold order
sales_order.unhold-Unhold order
sales_order.cancel-Cancel order
magento自带函数:
public function addComment($orderIncrementId, $status, $comment = null, $notify = false)
{
$order = $this->_initOrder($orderIncrementId);
$order->addStatusToHistory($status, $comment, $notify);
try {
if ($notify && $comment) {
$oldStore = Mage::getDesign()->getStore();
$oldArea = Mage::getDesign()->getArea();
Mage::getDesign()->setStore($order->getStoreId());
Mage::getDesign()->setArea('frontend');
}
$order->save();
$order->sendOrderUpdateEmail($notify, $comment);
if ($notify && $comment) {
Mage::getDesign()->setStore($oldStore);
Mage::getDesign()->setArea($oldArea);
}
} catch (Mage_Core_Exception $e) {
$this->_fault('status_not_changed', $e->getMessage());
}
return true;
}
Magento addStatusToHistory这个函数可以同时修改订单状态和添加订单备注
0 0
- magento修改订单状态、添加订单备注代码示例
- magento修改订单状态、添加订单备注代码示例
- magento 后台订单状态修改
- magento 修改订单状态为Completed
- magento -- 推荐插件 -- 订单备注
- 修改销售订单(备注)
- Magento订单状态迷思
- 50.magento 订单状态
- Magento SOAP API V2 开放接口修改订单状态
- 如何修改magento订单长度
- magento 修改订单详情模版
- Magento通过订单id修改订单创建时间的sql
- CRM_ORDER_MAINTAIN 修改订单简单示例
- magento打印订单里面添加运输方式
- 订单状态
- Magento开发教程 - 修改magento默认订单发票(invoice)
- magento模块 -- 如何修改magento订单模块中的订单ID的起始前缀
- 商品订单 添加、查询、状态、时间。。
- 汉字转化为拼音
- Matlab vs C#
- 树总结之并查集趣解
- Android 双侧侧滑菜单(主界面和菜单都会滑动)
- 联合体在单片机中的应用
- magento修改订单状态、添加订单备注代码示例
- system/build.prop参数说明
- C++ - 堆与栈
- Linux 管道
- 整数划分(四)
- Android:onNewIntent()触发机制及注意事项
- weblogic stuck实验2014-11-14
- Matlab向量/矩阵基本操作
- 设计与技术选型