WC_Order_Item_Shipping::offsetSet()publicWC 1.0ReturnTypeWillChange

Deprecated from version 4.4.0. It is no longer supported and can 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.

Return

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 8.7.0

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 );
}