PHP Class WC_Order_Item_Product

Since: 2.7.0
Author: WooThemes
Inheritance: extends WC_Order_Item
Exibir arquivo 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_item_download_url ( integer $download_id ) : string Get the Download URL.
get_item_downloads ( ) : array Get any associated downloadable files.
get_product ( ) : WC_Product | boolean Get the associated product.
get_product_id ( string $context = 'view' ) : integer Get product ID.
get_quantity ( string $context = 'view' ) : integer Get quantity.
get_subtotal ( string $context = 'view' ) : string Get subtotal.
get_subtotal_tax ( string $context = 'view' ) : string Get subtotal tax.
get_tax_class ( string $context = 'view' ) : string Get tax class.
get_tax_status ( ) : string Get tax status.
get_taxes ( string $context = 'view' ) : array Get fee taxes.
get_total ( string $context = 'view' ) : string Get total.
get_total_tax ( string $context = 'view' ) : string Get total tax.
get_type ( ) : string Get order item type.
get_variation_id ( string $context = 'view' ) : integer Get variation ID.
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_backorder_meta ( ) Set meta data for backordered products.
set_product ( WC_Product $product ) Set properties based on passed in product object.
set_product_id ( integer $value ) Set Product ID
set_quantity ( integer $value ) Set quantity.
set_subtotal ( string $value ) Line subtotal (before discounts).
set_subtotal_tax ( string $value ) Line subtotal tax (before discounts).
set_tax_class ( string $value ) Set tax class.
set_taxes ( array $raw_tax_data ) Set line taxes and totals for passed in taxes.
set_total ( string $value ) Line total (after discounts).
set_total_tax ( string $value ) Line total tax (after discounts).
set_variation ( array $data ) Set variation data (stored as meta data - write only).
set_variation_id ( integer $value ) Set variation ID.

Method Details

get_item_download_url() public method

Get the Download URL.
public get_item_download_url ( integer $download_id ) : string
$download_id integer
return string

get_item_downloads() public method

Get any associated downloadable files.
public get_item_downloads ( ) : array
return array

get_product() public method

Get the associated product.
public get_product ( ) : WC_Product | boolean
return WC_Product | boolean

get_product_id() public method

Get product ID.
public get_product_id ( string $context = 'view' ) : integer
$context string
return integer

get_quantity() public method

Get quantity.
public get_quantity ( string $context = 'view' ) : integer
$context string
return integer

get_subtotal() public method

Get subtotal.
public get_subtotal ( string $context = 'view' ) : string
$context string
return string

get_subtotal_tax() public method

Get subtotal tax.
public get_subtotal_tax ( string $context = 'view' ) : string
$context string
return string

get_tax_class() public method

Get tax class.
public get_tax_class ( string $context = 'view' ) : string
$context string
return string

get_tax_status() public method

Get tax status.
public get_tax_status ( ) : string
return string

get_taxes() public method

Get fee taxes.
public get_taxes ( string $context = 'view' ) : array
$context string
return array

get_total() public method

Get total.
public get_total ( string $context = 'view' ) : string
$context string
return string

get_total_tax() public method

Get total tax.
public get_total_tax ( string $context = 'view' ) : string
$context string
return string

get_type() public method

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

get_variation_id() public method

Get variation ID.
public get_variation_id ( string $context = 'view' ) : integer
$context string
return integer

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_backorder_meta() public method

Set meta data for backordered products.
public set_backorder_meta ( )

set_product() public method

Set properties based on passed in product object.
public set_product ( WC_Product $product )
$product WC_Product

set_product_id() public method

Set Product ID
public set_product_id ( integer $value )
$value integer

set_quantity() public method

Set quantity.
public set_quantity ( integer $value )
$value integer

set_subtotal() public method

Line subtotal (before discounts).
public set_subtotal ( string $value )
$value string

set_subtotal_tax() public method

Line subtotal tax (before discounts).
public set_subtotal_tax ( string $value )
$value string

set_tax_class() public method

Set tax class.
public set_tax_class ( string $value )
$value string

set_taxes() public method

Set line taxes and totals for passed in taxes.
public set_taxes ( array $raw_tax_data )
$raw_tax_data array

set_total() public method

Line total (after discounts).
public set_total ( string $value )
$value string

set_total_tax() public method

Line total tax (after discounts).
public set_total_tax ( string $value )
$value string

set_variation() public method

Set variation data (stored as meta data - write only).
public set_variation ( array $data )
$data array Key/Value pairs

set_variation_id() public method

Set variation ID.
public set_variation_id ( integer $value )
$value integer

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