WC_Order_Item_Shipping::offsetSetpublicWC 1.0ReturnTypeWillChange

Deprecated since 4.4.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

Offset set: for ArrayAccess/Backwards compatibility.

Method of the class: WC_Order_Item_Shipping{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Order_Item_Shipping = new WC_Order_Item_Shipping();
$WC_Order_Item_Shipping->offsetSet( $offset, $value );
$offset(string) (required)
Key.
$value(mixed) (required)
Value to set.

Changelog

Deprecated since 4.4.0

WC_Order_Item_Shipping::offsetSet() code WC 10.4.3

public function offsetSet( $offset, $value ) {
	wc_deprecated_function( 'WC_Order_Item_Shipping::offsetSet', '4.4.0', '' );
	if ( 'cost' === $offset ) {
		$offset = 'total';
	}
	parent::offsetSet( $offset, $value );
}