WC_Order_Item_Coupon::offsetSet()
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.
Method of the class: WC_Order_Item_Coupon{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Order_Item_Coupon = new WC_Order_Item_Coupon(); $WC_Order_Item_Coupon->offsetSet( $offset, $value );
- $offset(string) (required)
- Offset.
- $value(mixed) (required)
- Value.
Changelog
Deprecated since | 4.4.0 |
WC_Order_Item_Coupon::offsetSet() WC Order Item Coupon::offsetSet code WC 9.4.2
public function offsetSet( $offset, $value ) { wc_deprecated_function( 'WC_Order_Item_Coupon::offsetSet', '4.4.0', '' ); if ( 'discount_amount' === $offset ) { $offset = 'discount'; } elseif ( 'discount_amount_tax' === $offset ) { $offset = 'discount_tax'; } parent::offsetSet( $offset, $value ); }