• Resolved MiKeZZa

    (@mikezza)


    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)
  • Mirko P.

    (@rainfallnixfig)

    Hi there,

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    You can also visit the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers.

    Mirko P.

    (@rainfallnixfig)

    Hi @mikezza,

    We’ve not seen any activity on this thread for a while, so I’m marking it as resolved.

    Hopefully, you were able to find a solution and the above resources for developers were helpful. You may also consider getting in touch with a web developer or one of the services on our customizations page: https://woocommerce.com/customizations/.

    If you have questions on the inbuilt core features please feel free to open a new topic.

    Thanks.

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.