wc_update_order_item( int $item_id, array $args )

Update an item for an order.


Description Description


Parameters Parameters

$item_id

(Required) Item ID.

$args

(Required) Either order_item_type or order_item_name.


Top ↑

Return Return

(bool) True if successfully updated, false otherwise.


Top ↑

Source Source

File: includes/wc-order-item-functions.php

function wc_update_order_item( $item_id, $args ) {
	$data_store = WC_Data_Store::load( 'order-item' );
	$update     = $data_store->update_order_item( $item_id, $args );

	if ( false === $update ) {
		return false;
	}

	do_action( 'woocommerce_update_order_item', $item_id, $args );

	return true;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.2 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.