PHP Class WC_Legacy_Customer

Author: WooThemes
Inheritance: extends WC_Data
Show file Open project: woocommerce/woocommerce Class Usage Examples

Public Methods

Method Description
__get ( string $key ) : string __get function.
__isset ( mixed $key ) : boolean __isset legacy.
__set ( mixed $key, $value ) __set function.
calculated_shipping ( boolean $calculated = true ) Calculated shipping.
get_city ( ) Legacy get city.
get_country ( ) Legacy get country.
get_default_country ( ) : string Get default country for a customer.
get_default_state ( ) : string Get default state for a customer.
get_postcode ( ) Legacy get postcode.
get_state ( ) Legacy get state.
is_paying_customer ( $user_id = '' ) : boolean Is the user a paying customer?
save_data ( ) Save data function.
set_address ( $address ) Legacy set address.
set_address_2 ( $address ) Legacy set address.
set_city ( $city ) Legacy set city.
set_country ( $country ) Legacy set country.
set_default_data ( ) Set default data for a customer.
set_location ( string $country, string $state, string $postcode = '', string $city = '' ) Sets session data for the location.
set_postcode ( $postcode ) Legacy set postcode.
set_shipping_to_base ( ) Set customer shipping address to base address.
set_state ( $state ) Legacy set state.
set_to_base ( ) Set customer address to match shop base address.

Private Methods

Method Description
filter_legacy_key ( string $key ) : string Address and shipping_address are aliased, so we want to get the 'real' key name.

Method Details

__get() public method

__get function.
public __get ( string $key ) : string
$key string
return string

__isset() public method

__isset legacy.
public __isset ( mixed $key ) : boolean
$key mixed
return boolean

__set() public method

__set function.
public __set ( mixed $key, $value )
$key mixed

calculated_shipping() public method

Calculated shipping.
public calculated_shipping ( boolean $calculated = true )
$calculated boolean

get_city() public method

Legacy get city.
public get_city ( )

get_country() public method

Legacy get country.
public get_country ( )

get_default_country() public method

Get default country for a customer.
public get_default_country ( ) : string
return string

get_default_state() public method

Get default state for a customer.
public get_default_state ( ) : string
return string

get_postcode() public method

Legacy get postcode.
public get_postcode ( )

get_state() public method

Legacy get state.
public get_state ( )

is_paying_customer() public method

Is the user a paying customer?
public is_paying_customer ( $user_id = '' ) : boolean
return boolean

save_data() public method

Save data function.
public save_data ( )

set_address() public method

Legacy set address.
public set_address ( $address )

set_address_2() public method

Legacy set address.
public set_address_2 ( $address )

set_city() public method

Legacy set city.
public set_city ( $city )

set_country() public method

Legacy set country.
public set_country ( $country )

set_default_data() public method

Set default data for a customer.
public set_default_data ( )

set_location() public method

Sets session data for the location.
public set_location ( string $country, string $state, string $postcode = '', string $city = '' )
$country string
$state string
$postcode string (default: '')
$city string (default: '')

set_postcode() public method

Legacy set postcode.
public set_postcode ( $postcode )

set_shipping_to_base() public method

Set customer shipping address to base address.

set_state() public method

Legacy set state.
public set_state ( $state )

set_to_base() public method

Set customer address to match shop base address.
public set_to_base ( )