WC_Customer_Data_Store_Session::save_to_session()
Saves all customer data to the session.
Метод класса: WC_Customer_Data_Store_Session{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$WC_Customer_Data_Store_Session = new WC_Customer_Data_Store_Session(); $WC_Customer_Data_Store_Session->save_to_session( $customer );
- $customer(WC_Customer) (обязательный)
- Customer object.
Код WC_Customer_Data_Store_Session::save_to_session() WC Customer Data Store Session::save to session WC 7.3.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 ); }