You are here

function commerce_cart_order_session_delete in Commerce Core 7

Deletes all order IDs or a specific order ID from the cart orders session variable.

Parameters

$order_id: The order ID to remove from the array or NULL to delete the variable.

$completed: Boolean indicating whether or not the operation should delete from the completed orders array instead of the active cart orders array.

3 calls to commerce_cart_order_session_delete()
commerce_cart_commerce_checkout_complete in modules/cart/commerce_cart.module
Implements hook_commerce_checkout_complete().
commerce_cart_commerce_order_delete in modules/cart/commerce_cart.module
Implements hook_commerce_order_delete().
hook_commerce_order_delete in modules/order/commerce_order.api.php
Respond to order deletion.

File

modules/cart/commerce_cart.module, line 1279
Implements the shopping cart system and add to cart features.

Code

function commerce_cart_order_session_delete($order_id = NULL, $completed = FALSE) {
  if ($cart_provider = commerce_cart_get_provider()) {
    $cart_provider
      ->cartDelete($order_id, $completed);
  }
}