Update WooCommerce order status generates 2 identical confirmation mails
-
Hi all, I have created a plugin in the past. This plugins changes the default order status in WooCommerce. This always worked fine, but now it’s causing a problem.
The issue is; when this plugin is activated customers get 2 identical confirmation mails for their order. When I deactive it this doesn’t happen. So it must be caused by this plugin, but I don’t get it why… Does somebody have an idea?
<?php /** * Plugin Name: Custom Order Status * Plugin URI: ... * Description: Change order status by default to * Version: 1.0 * Author: ... * Author URI: ... */ #<editor-fold defaultstate="collapsed" desc="Default Status as Pending"> function action_woocommerce_payment_complete( $order_id ) { if( ! $order_id ) return; $order = wc_get_order( $order_id ); $order->update_status( 'wc-pending' ); }; // add the action add_action( 'woocommerce_payment_complete', 'action_woocommerce_payment_complete', 10, 3 ); #</editor-fold> ?>
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Update WooCommerce order status generates 2 identical confirmation mails’ is closed to new replies.