本文介绍了在Django-oscar中禁用订单电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用django-oscar建立了一个简单的电子商务网站.

I built a simple e-commerce site with django-oscar.

成功下订单后,无论设置如何,都会向客户发送一封电子邮件.我在 oscar/apps/customer/utils.py:Dispatcher.dispatch_order_messages

After a successful order placement an email is sent to client regardless of settings. I found the code located at oscar/apps/customer/utils.py:Dispatcher.dispatch_order_messages

是否可以关闭此行为?

推荐答案

您应该派发 checkout 应用(如此处),并覆盖 OrderPlacementMixin的 handle_successful_order 方法.您可以从oscar应用程序中复制代码,然后只需在发送确认消息的行中注释掉.

You should fork the checkout app (as described here) and override the handle_successful_order method of the OrderPlacementMixin. You can copy the code from the oscar app and simply comment out the line where the confirmation message is sent.

# self.send_confirmation_message(order, self.communication_type_code)

这篇关于在Django-oscar中禁用订单电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 10:41