Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter elevatorsound

    (@elevatorsound)

    That’s sorted it!

    Thanks 🙂

    elevatorsound

    (@elevatorsound)

    Hi,

    Unfortunately we’re still having this issue, despite the fix in the release last month.

    With this latest version, and for some versions previously, we get duplicate New Order admin emails for any orders customers place with Paypal or Klarna payment gateways. They aren’t duplicated with orders manually created in the admin area, created using our POS plugin, or if paid via Direct Bank Transfer payment method.

    It looks to be an issue in the “Checkout.php” file, with the “admin_new_order_email” function. The if statement check on line 28 doesn’t seem to be working or catching these payment methods properly. It’s still causing duplicate emails to be sent, which are already triggered when the default Processing order status is hit.

    As a quick fix could you please add a Checkbox into a settings page to turn on or off these New Order Emails being sent?

    I’m guessing you added this function so custom status’ which are set to have a payment complete state can send New Order Emails. Is it possible to instead write a check into the code that would stop the New Order email being sent if the status is Processing or one of the default WooCommerce status’?

    For now I’ve commented out line 12 "add_action( 'woocommerce_payment_complete', array( $this, 'admin_new_order_email' ), 10, 3 );" which has stopped it triggering the duplicate emails for us. As we don’t have any custom status’ that need to send a New Order email this has worked okay for our needs. For others who still need that to work you could try adding an if statement into the “admin_new_order_email” function that returns early if the order status is Processing etc. Untested but potentially something like this:

    if ( $order->get_status() == "wc-processing" ) {
    return;
    }


    Any timeline on when this fix might be implemented? It’s happening with the main official Paypal WooCoomerce plugin and Klarna plugins. Presumably that’s quite a large number of potential users of this plugin. Unless it’s somehow specific to our website/install.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)