woocommerce_rest_set_order_item

woocommerce_rest_set_order_item

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_rest_set_order_item') is found 2 times:

  • /includes/rest-api/Controllers/Version1/class-wc-rest-orders-v1-controller.php line 794
    		/**
    		 * Action hook to adjust item before save.
    		 * @since 3.0.0
    		 */
    		do_action( 'woocommerce_rest_set_order_item', $item, $posted );
    
    		// Save or add to order
    		if ( 'create' === $action ) {
    			$order->add_item( $item );
    		} else {
    			$item->save();
    
  • /includes/rest-api/Controllers/Version2/class-wc-rest-orders-v2-controller.php line 1047
    		 * @param array         $posted The item data.
    		 *
    		 * @since 4.5.0.
    		 */
    		do_action( 'woocommerce_rest_set_order_item', $item, $posted );
    
    		// If creating the order, add the item to it.
    		if ( 'create' === $action ) {
    			$order->add_item( $item );
    		} else {
    			$item->save();