magento 开发 -- 新增一个简单的退货流程
2014-05-14 14:56
218 查看
功能描述
顾客申请退货—>客服收到退货邮件—>客服电话确认—>操作系统—>财务退款
业务流程
1.在后台新增一个订单状态refunding
2.前台用户订单新增退货按钮
app/code/core/Mage/Sales/Block/Order/Recent.php
app/design/frontend/base/default/template/sales/order/recent.phtml
app/code/core/Mage/Sales/Controller/Abstract.php
之后的操作,由客服去完成
顾客申请退货—>客服收到退货邮件—>客服电话确认—>操作系统—>财务退款
业务流程
1.在后台新增一个订单状态refunding
2.前台用户订单新增退货按钮
app/code/core/Mage/Sales/Block/Order/Recent.php
//退货链接 public function getRefundingUrl($order) { return $this->getUrl('sales/order/refunding',array('order_id'=> $order->getId())); }
app/design/frontend/base/default/template/sales/order/recent.phtml
<?php if ($_order->getStatus() == 'complete') : ?> <span class="separator">|</span> <a href="<?php echo $this->getRefundingUrl($_order) ?>"><?php echo $this->__('Refunding') ?></a> <?php endif ?>
app/code/core/Mage/Sales/Controller/Abstract.php
//退货功能 public function refundingAction() { if (!$this->_loadValidOrder()) { return; } $order = Mage::registry('current_order'); if ($this->_canViewOrder($order) && $order->getStatus()=='complete') { //更改订单状态 $order->setData('status','refunding'); $order->save(); //发送邮件给客服 $storeId = $order->getStoreId(); $customerName = $order->getCustomer_lastname().' '.$order->getCustomer_firstname(); $increment_id = $order->getIncrement_id(); $shippingId = $order->getShipping_address_id(); $address = Mage::getModel('sales/order_address')->load($shippingId); $telephone = $address->getTelephone(); $user_email = $address->getEmail(); //接收邮件在后台Custom Email 1里配置,默认发送邮给Custom Email 1里配置的邮件地址 $receiveEmail = Mage::getStoreConfig('trans_email/ident_custom1/email'); $receiveName = Mage::getStoreConfig('trans_email/ident_custom1/name'); $vars = array('user_name' => $customerName, 'increment_id' => $increment_id , 'user_email'=>$user_email, 'telephone'=>$telephone ,'receive_name'=>$receiveName); try { $templateId = "Order Refunding"; $emailTemplate = Mage::getModel('core/email_template')->loadByCode($templateId); $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email', $storeId)); $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/name', $storeId)); //echo $emailTemplate->getProcessedTemplate($vars); //预览邮件效果 $emailTemplate->send($receiveEmail,$receiveName, $vars); }catch (Exception $e){ Mage::log('The Order '.$increment_id.' is refunding,But not email to Customer Service'); Mage::getSingleton('catalog/session') ->addException($e, $this->__('Some emails were not sent.')); } } $this->_redirect('*/*/history'); }
之后的操作,由客服去完成
相关文章推荐
- magento 开发 -- 新增一个简单的退货流程
- 关于一个项目的简单开发流程(需求,数据库,编码)
- 【Star CCM+实例】开发一个简单的计算流程.md
- 一个项目的简单开发流程——需求、数据库、编码
- react-natvie 开发一个简单的app 流程
- 游戏开发简单流程1(转贴)
- 一个简单的带Body的自定义Tag开发过程
- BPEL学习:创建一个简单的流程
- 一个简单的例子说明Struts的工作流程
- 使用C#开发一个简单的P2P应用
- 开发一个简单的WebPart
- 一个简单的Eclipse插件开发的例子——HelloWorld【转载】
- [webservices开发]使用XFire开发一个简单的web服务
- [webservices开发]使用XFire开发一个简单的web服务
- 开发一个简单的WebPart
- 使用C#开发一个简单的P2P应用
- 一个购物车的简单实现(多层开发)
- 一个简单的学生成绩管理软件(ODBC开发)
- 基于S3C4510B的一个简单BSP的开发报告
- Microsoft的软件开发简单流程 -- 转自tassadar's blog