• Resolved felixhelix

    (@felixhelix)


    Hi,
    if customers select payment via the included WooCommerce PayPal option, but cancel the order, order emails are send nevertheless to the admin and the customer. Also, while the status changes appropriately in the orders list, no email is sent to the admin about this event. This seems not to be the intended behavior, which should be to send an email about the cancellation to the admin and no order emails at all.
    Any ideas?
    Felix

Viewing 16 replies (of 16 total)
  • Thread Starter felixhelix

    (@felixhelix)

    Dear Bernhard,
    thanks a lot for the reply. That makes it clear why this broke after update!
    Someon helped me with a snippet to put in the functions.php, which I modified for our needs and which mimics your code. It uses the ‘woocommerce_order_status_changed’ trigger:

    // Send Email when status changes from pending to cancelled
    add_action(‘woocommerce_order_status_changed’, ‘send_custom_email_notifications’, 10, 4 );
    function send_custom_email_notifications( $order_id, $old_status, $new_status, $order ){
    if ( $new_status == ‘cancelled’ & $old_status == ‘pending’ ){
    $wc_emails = WC()->mailer()->get_emails(); // Get all WC_emails objects instances
    $wc_emails[‘WC_Email_Cancelled_Order’]->trigger( $order_id );
    }
    }

    Best regards,
    Felix

Viewing 16 replies (of 16 total)
  • The topic ‘Order Email Send on PayPal Cancellation’ is closed to new replies.