Support

Account

Home Forums Backend Issues (wp-admin) WooCommerce $order woes Reply To: WooCommerce $order woes

  • Did anyone manage to find a solution to this using ACF?

    I have tried to change the priority of the order completed email from Woocommerce but it still fires before the ACF field updates.

    Here is what I tried:

    add_action( 'woocommerce_email', 'unhook_those_pesky_emails' );
    
    function unhook_those_pesky_emails( $email_class ) {
    		remove_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ) );
            add_action( 'woocommerce_order_status_completed_notification', array( $email_class->emails['WC_Email_Customer_Completed_Order'], 'trigger' ), 90, 2 );
    }