WordPress at Your Fingertips
function is not described

WC_Customer_Data_Store_Session::save_to_session() public WC 1.0

Saves all customer data to the session.

{} It's a method of the class: WC_Customer_Data_Store_Session{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Customer_Data_Store_Session = new WC_Customer_Data_Store_Session();
$WC_Customer_Data_Store_Session->save_to_session( $customer );
$customer(WC_Customer) (required)
Customer object.

Code of WC_Customer_Data_Store_Session::save_to_session() WC 5.8.0

public function save_to_session( $customer ) {
	$data = array();
	foreach ( $this->session_keys as $session_key ) {
		$function_key = $session_key;
		if ( 'billing_' === substr( $session_key, 0, 8 ) ) {
			$session_key = str_replace( 'billing_', '', $session_key );
		}
		$data[ $session_key ] = (string) $customer->{"get_$function_key"}( 'edit' );
	}
	WC()->session->set( 'customer', $data );
}