WordPress at Your Fingertips
function is not described

WC_Order_Item_Product::offsetSet() public WC 1.0

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.

OffsetSet for ArrayAccess/Backwards compatibility.

{} It's a method of the class: WC_Order_Item_Product{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Order_Item_Product = new WC_Order_Item_Product();
$WC_Order_Item_Product->offsetSet( $offset, $value );
$offset(string) (required)
Offset.
$value(mixed) (required)
Value.

Changelog

Deprecated 4.4.0

Code of WC_Order_Item_Product::offsetSet() WC 5.6.0

public function offsetSet( $offset, $value ) {
	wc_deprecated_function( 'WC_Order_Item_Product::offsetSet', '4.4.0', '' );
	if ( 'line_subtotal' === $offset ) {
		$offset = 'subtotal';
	} elseif ( 'line_subtotal_tax' === $offset ) {
		$offset = 'subtotal_tax';
	} elseif ( 'line_total' === $offset ) {
		$offset = 'total';
	} elseif ( 'line_tax' === $offset ) {
		$offset = 'total_tax';
	} elseif ( 'line_tax_data' === $offset ) {
		$offset = 'taxes';
	} elseif ( 'qty' === $offset ) {
		$offset = 'quantity';
	}
	parent::offsetSet( $offset, $value );
}