Execute a function on “place an order” submit in Woocommerce

Is there a Woocommerce before or after “Place an order” (check out) hook so i can execute a function when the user clicks on the “Place an Order” button. I couldn’t find the proper hook for this.

Related posts

2 comments

  1. This one will hook you just after the order was create

    add_action( 'woocommerce_checkout_order_processed', 'is_express_delivery',  1, 1  );
    function is_express_delivery( $order_id ){
    
       $order = new WC_Order( $order_id );
       //You can do here whatever you want
    
    }
    

Comments are closed.