PHP Class WC_Order_Item_Coupon

Since: 2.7.0
Author: WooThemes
Inheritance: extends WC_Order_Item
ファイルを表示 Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Property Type Description
$extra_data array Order Data array. This is the core order data exposed in APIs since 2.7.0.

Public Methods

Method Description
get_code ( string $context = 'view' ) : string Get coupon code.
get_discount ( string $context = 'view' ) : string Get discount amount.
get_discount_tax ( $context = 'view' ) : string Get discounted tax amount.
get_name ( string $context = 'view' ) : string Get order item name.
get_type ( ) : string Get order item type.
offsetExists ( string $offset ) : boolean offsetExists for ArrayAccess
offsetGet ( string $offset ) : mixed offsetGet for ArrayAccess/Backwards compatibility.
offsetSet ( string $offset, mixed $value ) offsetSet for ArrayAccess/Backwards compatibility.
set_code ( string $value ) Set code.
set_discount ( string $value ) Set discount amount.
set_discount_tax ( string $value ) Set discounted tax amount.
set_name ( string $value ) Set order item name.

Method Details

get_code() public method

Get coupon code.
public get_code ( string $context = 'view' ) : string
$context string
return string

get_discount() public method

Get discount amount.
public get_discount ( string $context = 'view' ) : string
$context string
return string

get_discount_tax() public method

Get discounted tax amount.
public get_discount_tax ( $context = 'view' ) : string
return string

get_name() public method

Get order item name.
public get_name ( string $context = 'view' ) : string
$context string
return string

get_type() public method

Get order item type.
public get_type ( ) : string
return string

offsetExists() public method

offsetExists for ArrayAccess
public offsetExists ( string $offset ) : boolean
$offset string
return boolean

offsetGet() public method

offsetGet for ArrayAccess/Backwards compatibility.
Deprecation: Add deprecation notices in future release.
public offsetGet ( string $offset ) : mixed
$offset string
return mixed

offsetSet() public method

offsetSet for ArrayAccess/Backwards compatibility.
Deprecation: Add deprecation notices in future release.
public offsetSet ( string $offset, mixed $value )
$offset string
$value mixed

set_code() public method

Set code.
public set_code ( string $value )
$value string

set_discount() public method

Set discount amount.
public set_discount ( string $value )
$value string

set_discount_tax() public method

Set discounted tax amount.
public set_discount_tax ( string $value )
$value string

set_name() public method

Set order item name.
public set_name ( string $value )
$value string

Property Details

$extra_data protected_oe property

Order Data array. This is the core order data exposed in APIs since 2.7.0.
Since: 2.7.0
protected array $extra_data
return array