Class WC_Customer

Customer

The WooCommerce customer class handles storage of the current customer's data, such as location.

Package: WooCommerce\Classes
Category: Class
Author: WooThemes
Version: 1.6.4
Class: WC_Customer
Located at includes/class-wc-customer.php

Methods summary

public
# __construct( )

Constructor for the customer class loads the customer data.

Constructor for the customer class loads the customer data.

public
# save_data( )

save_data function.

save_data function.

public boolean
# __isset( mixed $property )

__set function.

__set function.

Parameters

$property
mixed
$property

Returns

boolean
public mixed|null
# __get( mixed $property )

__get function.

__get function.

Parameters

$property
mixed
$property

Returns

mixed|null
public
# __set( mixed $property, mixed $value )

__set function.

__set function.

Parameters

$property
mixed
$property
$value
mixed
$value
public boolean
# has_calculated_shipping( )

has_calculated_shipping function.

has_calculated_shipping function.

Returns

boolean
public
# set_to_base( )

Set customer address to match shop base address.

Set customer address to match shop base address.

public
# set_shipping_to_base( )

Set customer shipping address to base address.

Set customer shipping address to base address.

public boolean
# is_customer_outside_base( )

Is customer outside base country (for tax purposes)?

Is customer outside base country (for tax purposes)?

Returns

boolean
public boolean
# is_paying_customer( mixed $user_id )

Is the user a paying customer?

Is the user a paying customer?

Returns

boolean
public boolean
# is_vat_exempt( )

Is customer VAT exempt?

Is customer VAT exempt?

Returns

boolean
public string
# get_state( )

Gets the state from the current session.

Gets the state from the current session.

Returns

string
public string
# get_country( )

Gets the country from the current session

Gets the country from the current session

Returns

string
public string
# get_postcode( )

Gets the postcode from the current session.

Gets the postcode from the current session.

Returns

string
public string
# get_city( )

Get the city from the current session.

Get the city from the current session.

Returns

string
public string
# get_address( )

Gets the address from the current session.

Gets the address from the current session.

Returns

string
public string
# get_address_2( )

Gets the address2 from the current session.

Gets the address2 from the current session.

Returns

string
public string
# get_shipping_state( )

Gets the state from the current session.

Gets the state from the current session.

Returns

string
public string
# get_shipping_country( )

Gets the country from the current session.

Gets the country from the current session.

Returns

string
public string
# get_shipping_postcode( )

Gets the postcode from the current session.

Gets the postcode from the current session.

Returns

string
public string
# get_shipping_city( )

Gets the city from the current session.

Gets the city from the current session.

Returns

string
public string
# get_shipping_address( )

Gets the address from the current session.

Gets the address from the current session.

Returns

string
public string
# get_shipping_address_2( )

Gets the address2 from the current session.

Gets the address2 from the current session.

Returns

string
public array
# get_taxable_address( )

get_taxable_address function.

get_taxable_address function.

Returns

array
public
# set_location( mixed $country, mixed $state, string $postcode = '', string $city = '' )

Sets session data for the location.

Sets session data for the location.

Parameters

$country
mixed
$country
$state
mixed
$state
$postcode
string
$postcode (default: '')
$city
string
$city (default: '')
public
# set_country( mixed $country )

Sets session data for the country.

Sets session data for the country.

Parameters

$country
mixed
$country
public
# set_state( mixed $state )

Sets session data for the state.

Sets session data for the state.

Parameters

$state
mixed
$state
public
# set_postcode( mixed $postcode )

Sets session data for the postcode.

Sets session data for the postcode.

Parameters

$postcode
mixed
$postcode
public
# set_city( mixed $city )

Sets session data for the city.

Sets session data for the city.

Parameters

$city
mixed
$postcode
public
# set_address( mixed $address )

Sets session data for the address.

Sets session data for the address.

Parameters

$address
mixed
$address
public
# set_address_2( mixed $address_2 )

Sets session data for the address2.

Sets session data for the address2.

Parameters

$address_2
mixed
$address2
public
# set_shipping_location( mixed $country, string $state = '', string $postcode = '', string $city = '' )

Sets session data for the location.

Sets session data for the location.

Parameters

$country
mixed
$country
$state
string
$state (default: '')
$postcode
string
$postcode (default: '')
$city
string
$city (default: '')
public
# set_shipping_country( mixed $country )

Sets session data for the country.

Sets session data for the country.

Parameters

$country
mixed
$country
public
# set_shipping_state( mixed $state )

Sets session data for the state.

Sets session data for the state.

Parameters

$state
mixed
$state
public
# set_shipping_postcode( mixed $postcode )

Sets session data for the postcode.

Sets session data for the postcode.

Parameters

$postcode
mixed
$postcode
public
# set_shipping_city( mixed $city )

Sets session data for the city.

Sets session data for the city.

Parameters

$city
mixed
$postcode
public
# set_shipping_address( mixed $address )

Sets session data for the address.

Sets session data for the address.

Parameters

$address
mixed
$address
public
# set_shipping_address_2( mixed $address_2 )

Sets session data for the address2.

Sets session data for the address2.

Parameters

$address_2
mixed
$address2
public
# set_is_vat_exempt( mixed $is_vat_exempt )

Sets session data for the tax exemption.

Sets session data for the tax exemption.

Parameters

$is_vat_exempt
mixed
$is_vat_exempt
public
# calculated_shipping( mixed $calculated = true )

calculated_shipping function.

calculated_shipping function.

Parameters

$calculated
mixed
$calculated
public array
# get_downloadable_products( )

Gets a user's downloadable products if they are logged in.

Gets a user's downloadable products if they are logged in.

Returns

array
Array of downloadable products

Magic methods summary

Properties summary

protected mixed $_data
#

Stores customer data as an array

Stores customer data as an array

WooCommerce API documentation generated by ApiGen 2.8.0