You are here

public function CartProviderInterface::finalizeCart in Commerce Core 8.2

Finalizes the given cart order.

Removes the cart flag from the order and saves it. If the user is anonymous, moves the cart ID from the active to the completed cart session.

Parameters

\Drupal\commerce_order\Entity\OrderInterface $cart: The cart order.

bool $save_cart: Whether to immediately save the cart or not.

1 method overrides CartProviderInterface::finalizeCart()
CartProvider::finalizeCart in modules/cart/src/CartProvider.php
Finalizes the given cart order.

File

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

Class

CartProviderInterface
Creates and loads carts for anonymous and authenticated users.

Namespace

Drupal\commerce_cart

Code

public function finalizeCart(OrderInterface $cart, $save_cart = TRUE);