PHP Class WC_Customer_Data_Store_Session

Author: WooThemes
Inheritance: extends WC_Data_Store_WP, implements WC_Customer_Data_Store_Interface, implements WC_Object_Data_Store_Interface
Show file Open project: woocommerce/woocommerce

Protected Properties

Property Type Description
$session_keys array ..)

Public Methods

Method Description
create ( &$customer ) Simply update the session.
delete ( &$customer, array $args = [] ) Deletes a customer from the database.
get_last_order ( &$customer ) : WC_Order | false Gets the customers last order.
get_order_count ( &$customer ) : integer Return the number of orders this customer has.
get_total_spent ( &$customer ) : float Return how much money this customer has spent.
read ( &$customer ) Read customer data from the session.
save_to_session ( $customer ) Saves all customer data to the session.
update ( &$customer ) Simply update the session.

Protected Methods

Method Description
set_defaults ( &$customer ) Load default values if props are unset.

Method Details

create() public method

Simply update the session.
public create ( &$customer )

delete() public method

Deletes a customer from the database.
Since: 2.7.0
public delete ( &$customer, array $args = [] )
$args array Array of args to pass to the delete method.

get_last_order() public method

Gets the customers last order.
Since: 2.7.0
public get_last_order ( &$customer ) : WC_Order | false
return WC_Order | false

get_order_count() public method

Return the number of orders this customer has.
Since: 2.7.0
public get_order_count ( &$customer ) : integer
return integer

get_total_spent() public method

Return how much money this customer has spent.
Since: 2.7.0
public get_total_spent ( &$customer ) : float
return float

read() public method

Read customer data from the session.
Since: 2.7.0
public read ( &$customer )

save_to_session() public method

Saves all customer data to the session.
public save_to_session ( $customer )

set_defaults() protected method

Load default values if props are unset.
protected set_defaults ( &$customer )

update() public method

Simply update the session.
public update ( &$customer )

Property Details

$session_keys protected property

..)
protected array $session_keys
return array