woocommerce_cancelled_order

woocommerce_cancelled_order

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_cancelled_order') is found 1 times:

  • /includes/class-wc-form-handler.php line 797
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
        $order->update_status( OrderStatus::CANCELLED, __( 'Order cancelled by customer.', 'woocommerce' ) );
     
        wc_add_notice( apply_filters( 'woocommerce_order_cancelled_notice', __( 'Your order was cancelled.', 'woocommerce' ) ), apply_filters( 'woocommerce_order_cancelled_notice_type', 'notice' ) );
     
        do_action( 'woocommerce_cancelled_order', $order->get_id() );
     
    } elseif ( $user_can_cancel && ! $order_can_cancel ) {
        wc_add_notice( __( 'Your order can no longer be cancelled. Please contact us if you need assistance.', 'woocommerce' ), 'error' );
    } else {
        wc_add_notice( __( 'Invalid order.', 'woocommerce' ), 'error' );
    }

See this hook used in plugins: