You are here

public function CartProviderInterface::getCart in Commerce Core 8.2

Gets the cart order for the given store and user.

Parameters

string $order_type: The order type ID.

\Drupal\commerce_store\Entity\StoreInterface $store: The store. If omitted, the current store is assumed.

\Drupal\Core\Session\AccountInterface $account: The user. If omitted, the current user is assumed.

Return value

\Drupal\commerce_order\Entity\OrderInterface|null The cart order, or NULL if none found.

1 method overrides CartProviderInterface::getCart()
CartProvider::getCart in modules/cart/src/CartProvider.php
Gets the cart order for the given store and user.

File

modules/cart/src/CartProviderInterface.php, line 61

Class

CartProviderInterface
Creates and loads carts for anonymous and authenticated users.

Namespace

Drupal\commerce_cart

Code

public function getCart($order_type, StoreInterface $store = NULL, AccountInterface $account = NULL);