简体   繁体   中英

Magento Order Emails

I am using magento 1.7.Can anyone help/advise on this??

Also using EPDQ Barclaycard module.

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?

Have I missed something?

Thanks in advance

Magento sends email order confirmations as soon as the order is placed. 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).

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;

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. I am surprised the EPDQ module you have does not work like this already, might be worth contacting them and highlighting the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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