Thread Starter
olppa
(@olppa)
Polylang’s support answered:
You are right, Brightplugins_COS and Polylang send this email twice.
It requires to develop a compatibility. It is the first time we have encountered an issue with this plugin. As of today, we don’t plan a compatibility.
Would you please contact the development Brightplugins Custom Order Status Manager team? Maybe they already encountered this feedback and have a workaround.
If Brightplugins has any questions about Polylang, feel free to tell them to contact us. We will provide Polylang license and guide them in our code.
Hello,
I hope you are doing well.
Thank you for the report and for the tests conducted. We have forwarded the case to the appropriate team for their internal review, and we will keep track from this thread, sharing any updates or solutions here.
We appreciate your participation.
Best regards,peace!
-
This reply was modified 8 months, 2 weeks ago by
threadi.
-
This reply was modified 8 months, 2 weeks ago by
mathdaniel.
Thread Starter
olppa
(@olppa)
Hi @mathdaniel
I tried disabling the COS plugin and the duplicate emails went away.
I’ve narrowed down the issue to Checkout.php.
Your duplicates were caused by Checkout::admin_new_order_email triggering WC_Email_New_Order on woocommerce_payment_complete, on top of WooCommerce’s own email on status change. Please either:
- remove that trigger by default,
- gate it to offline methods only, and/or
- add an idempotency guard (order meta) so it can’t send twice.
Hello @olppa,
I hope you are well.
As I had mentioned, this was referred to the team in charge, which works through organized sprints to address the needs of all users.
Thanks once again for your participation; what you have shared has been taken into account for analysis.
Best regards, peace!
Hi @olppa,
Hope you’re doing well.
We recently released an update (v2.0) that addresses duplicate “New Order” admin emails occurring with certain payment methods.
Please make sure you are running the latest version and test again in your environment.
Let us know the result after updating.
Best regards,peace!
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!
Hello @elevatorsound,
Hope you are doing well.
Thank you for sharing this with us.
Regarding your report on email redundancy in automated gateways and the behavior of the woocommerce_payment_complete hook:
Your case has already been escalated to the development department to validate the logic of the Checkout.php file and implement the necessary conditional to avoid duplicates in native statuses.
We will get back to you with a response ASAP.
Best regards, Peace!