PHP Class WC_Legacy_Coupon

Legacy and deprecated functions are here to keep the WC_Legacy_Coupon class clean. This class will be removed in future versions.
Author: WooThemes
Inheritance: extends WC_Data
Show file Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__get ( string $key ) : mixed Magic __get method for backwards compatibility. Maps legacy vars to new getters.
__isset ( string $key ) : boolean Magic __isset method for backwards compatibility. Legacy properties which could be accessed directly in the past.
apply_before_tax ( ) : boolean Check if coupon needs applying before tax.
dcr_usage_count ( string $used_by = '' ) Decrease usage count for current coupon.
enable_free_shipping ( ) : boolean Check if a coupon enables free shipping.
exclude_sale_items ( ) : boolean Check if a coupon excludes sale items.
format_array ( string | array $array ) : array Format loaded data as array.
inc_usage_count ( string $used_by = '' ) Increase usage count for current coupon.

Method Details

__get() public method

Magic __get method for backwards compatibility. Maps legacy vars to new getters.
public __get ( string $key ) : mixed
$key string
return mixed

__isset() public method

Magic __isset method for backwards compatibility. Legacy properties which could be accessed directly in the past.
public __isset ( string $key ) : boolean
$key string
return boolean

apply_before_tax() public method

Check if coupon needs applying before tax.
public apply_before_tax ( ) : boolean
return boolean

dcr_usage_count() public method

Decrease usage count for current coupon.
public dcr_usage_count ( string $used_by = '' )
$used_by string Either user ID or billing email

enable_free_shipping() public method

Check if a coupon enables free shipping.
public enable_free_shipping ( ) : boolean
return boolean

exclude_sale_items() public method

Check if a coupon excludes sale items.
public exclude_sale_items ( ) : boolean
return boolean

format_array() public method

Format loaded data as array.
public format_array ( string | array $array ) : array
$array string | array
return array

inc_usage_count() public method

Increase usage count for current coupon.
public inc_usage_count ( string $used_by = '' )
$used_by string Either user ID or billing email