• Resolved marijn1887

    (@marijn1887)


    I think I need to change the order flow within WooCommerce. For particular statuses I would really like to remove the status Cancelled and Failed from applying when a customer fails to complete the payment.

    Why?

    I use a custom status: Payment Due. Once an order gets the status Payment Due it will automatically trigger a email after 14 days reminding the customer to pay for their order.
    Now when this customer tries to pay but it fails for whatever reason the order will get the status Cancelled.
    But I need this order to get back to status Payment Due or something similar so I know payment is still due. Once it gets to cancelled it’s easy to forget about it or just not noticing it and therefor never receive the payment.

    Thanks in advance. All help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter marijn1887

    (@marijn1887)

    FYI following hook worked for me:

    add_action( ‘woocommerce_order_status_reminder_to_failed’, ‘change_status_to_payment_required’ , 10, 10 );

    function change_status_to_payment_required( $order_id ) {
    $order = wc_get_order($order_id);
    $order->update_status( ‘payment-required’ );
    }

    Just change the name of statuses for it to work in your WooCommerce shop.

    melinda a11n

    (@melindahelt)

    Automattic Happiness Engineer

    Thanks for providing a solution for the community!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Status: remove order flow to cancelled’ is closed to new replies.