woocommerce_update_order

woocommerce_update_order

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

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_update_order') is found 4 times:

  • /includes/data-stores/class-wc-order-data-store-cpt.php line 196
     
    		if ( $new_status !== $previous_status && in_array( $previous_status, array( 'new', 'auto-draft', 'draft' ), true ) ) {
    			do_action( 'woocommerce_new_order', $order->get_id(), $order );
    		} else {
    			do_action( 'woocommerce_update_order', $order->get_id(), $order );
    		}
    	}
    
    	/**
    	 * Helper method that updates all the post meta for an order based on it's settings in the WC_Order class.
    	 *
    
  • /includes/legacy/api/v2/class-wc-api-orders.php line 629
     
    			wc_delete_shop_order_transients( $order );
    
    			do_action( 'woocommerce_api_edit_order', $order->get_id(), $data, $this );
    			do_action( 'woocommerce_update_order', $order->get_id() );
    
    			return $this->get_order( $id );
    
    		} catch ( WC_Data_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => 400 ) );
    		} catch ( WC_API_Exception $e ) {
    
  • /includes/legacy/api/v3/class-wc-api-orders.php line 666
     
    			wc_delete_shop_order_transients( $order );
    
    			do_action( 'woocommerce_api_edit_order', $order->get_id(), $data, $this );
    			do_action( 'woocommerce_update_order', $order->get_id() );
    
    			return $this->get_order( $id );
    		} catch ( WC_Data_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => 400 ) );
    		} catch ( WC_API_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    
  • /src/Internal/DataStores/Orders/OrdersTableDataStore.php line 2518
    			|| ( ! empty( $changes ) && ! array_diff_key( $changes, array_flip( $this->get_post_data_store_for_backfill()->get_internal_data_store_key_getters() ) ) ) ) {
    			return;
    		}
    
    		do_action( 'woocommerce_update_order', $order->get_id(), $order ); // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingHookComment
    	}
    
    	/**
    	 * Proxy to udpating order meta. Here for backward compatibility reasons.
    	 *
    	 * @param \WC_Order $order Order object.
    

See this hook used in plugins: