Automattic\WooCommerce\StoreApi\Routes\V1
AbstractCartRoute::get_cart_token()
Generates a cart token for the response headers.
Current namespace is used as the token Issuer.
*
Метод класса: AbstractCartRoute{}
Хуков нет.
Возвращает
Строку
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_cart_token();
Код AbstractCartRoute::get_cart_token() AbstractCartRoute::get cart token WC 8.7.0
protected function get_cart_token() { return JsonWebToken::create( [ 'user_id' => wc()->session->get_customer_id(), 'exp' => $this->get_cart_token_expiration(), 'iss' => $this->namespace, ], $this->get_cart_token_secret() ); }