简体   繁体   English

Magento订购电子邮件

[英]Magento Order Emails

I am using magento 1.7.Can anyone help/advise on this?? 我正在使用magento 1.7。有人可以对此提供帮助/建议吗?

Also using EPDQ Barclaycard module. 还使用EPDQ Barclaycard模块。

Everything seems ok with capturing payments, however when I go to checkout fill in all the details up to Payment Information select card type and hit continue, then place order a new order email has been sent but it hasnt been paid for yet! 捕获付款似乎一切正常,但是当我结帐时,请填写所有详细信息,直到“付款信息”选择卡类型并点击“继续”,然后下订单已发送新订单电子邮件,但尚未付款!

Is there anyway that this can be prevented till payment has been captured via Barclaycard? 无论如何,在通过Barclaycard捕获付款之前,可以防止这种情况发生吗?

Have I missed something? 我错过了什么吗?

Thanks in advance 提前致谢

Magento sends email order confirmations as soon as the order is placed. Magento在下订单后立即发送电子邮件订单确认。 If you are redirecting the user to a payment gateway after the order has been placed but not paid for you will need to modify your payment module to use magento's payment redirect setup to get it to ignore the confirmation email (See Mage_Checkout_Model_Type_Onepage class saveOrder() method). 如果您在下订单但未付款后将用户重定向到付款网关,则需要修改付款模块以使用magento的付款重定向设置来使其忽略确认电子邮件(请参阅Mage_Checkout_Model_Type_OnepagesaveOrder()方法) )。

You should see some code like; 您应该看到一些类似的代码;

/**
 * a flag to set that there will be redirect to third party after confirmation
 * eg: paypal standard ipn
 */
$redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();
/**
 * we only want to send to customer about new order when there is no redirect to third party
 */
if (!$redirectUrl && $order->getCanSendNewEmailFlag()) {
    try {
        $order->sendNewOrderEmail();
    } catch (Exception $e) {
        Mage::logException($e);
    }
}

So this gives you a few options. 因此,这为您提供了一些选择。 Extend your payment module so that it sets the order place redirect url, but this might mess up your payment module depending on how it was coded or you could extend the above class into your own module (do not mod the core), override the saveOrder() method and check the payment method in the if statement shown above a bit like; 扩展您的付款模块,以便它设置定单重定向网址,但这可能会使您的付款模块混乱,具体取决于它的编码方式,或者您可以将上述类扩展到您自己的模块中(不要修改核心),覆盖saveOrder()方法和上面所示的if语句中的付款方式检查有点像;

if (!$redirectUrl && $order->getPayment()->getMethod() != 'your_payment_method' && $order->getCanSendNewEmailFlag()) {
    try {
        $order->sendNewOrderEmail();
    } catch (Exception $e) {
        Mage::logException($e);
    }
}

You would then to handle IPN notification to get it to send the email when a successful payment IPN is received, I would suggest you take a look at the PayPal Standard module that ships with Magento for some pointers as this is exactly how it works. 然后,您将处理IPN通知,以便在收到成功的付​​款IPN后将其发送给电子邮件,我建议您看一下Magento随附的PayPal Standard模块以获取一些指示信息,因为这正是其工作原理。 I am surprised the EPDQ module you have does not work like this already, might be worth contacting them and highlighting the issue. 令您惊讶的是,您拥有的EPDQ模块还不能像这样正常工作,可能值得联系他们并重点指出问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM