public function CartProviderInterface::getCarts in Commerce Core 8.2
Gets all cart orders for the given user.
Parameters
\Drupal\Core\Session\AccountInterface|null $account: The user. If omitted, the current user is assumed.
\Drupal\commerce_store\Entity\StoreInterface|null $store: The store. If omitted, carts belonging to all stores are returned.
Return value
\Drupal\commerce_order\Entity\OrderInterface[] A list of cart orders.
1 method overrides CartProviderInterface::getCarts()
- CartProvider::getCarts in modules/
cart/ src/ CartProvider.php - Gets all cart orders for the given user.
File
- modules/
cart/ src/ CartProviderInterface.php, line 89
Class
- CartProviderInterface
- Creates and loads carts for anonymous and authenticated users.
Namespace
Drupal\commerce_cartCode
public function getCarts(AccountInterface $account = NULL, StoreInterface $store = NULL);