You are here

private function CartTokenSession::getCurrentRequestCartToken in Commerce Cart API 8

Get the cart token from the request.

Return value

string The cart token.

6 calls to CartTokenSession::getCurrentRequestCartToken()
CartTokenSession::addCartId in src/CartTokenSession.php
Adds the given cart order ID to the session.
CartTokenSession::deleteCartId in src/CartTokenSession.php
Deletes the given cart order id from the session.
CartTokenSession::getCartIds in src/CartTokenSession.php
Gets all cart order ids from the session.
CartTokenSession::getTokenCartData in src/CartTokenSession.php
Get the token cart data.
CartTokenSession::hasCartId in src/CartTokenSession.php
Checks whether the given cart order ID exists in the session.

... See full list

File

src/CartTokenSession.php, line 114

Class

CartTokenSession
Decorates the cart session to support cart tokens.

Namespace

Drupal\commerce_cart_api

Code

private function getCurrentRequestCartToken() {
  $request = $this->requestStack
    ->getCurrentRequest();
  assert($request instanceof Request);
  return $request->headers
    ->get(static::HEADER_NAME);
}