You are here

function uc_cart_remove_item in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \uc_cart_remove_item()
  2. 7.3 uc_cart/uc_cart.module \uc_cart_remove_item()

Remove an item from the cart

3 calls to uc_cart_remove_item()
hook_update_cart_item in docs/hooks.php
Handle requests to update a cart item.
uc_product_kit_update_cart_item in uc_product_kit/uc_product_kit.module
Implementation of Übercart's hook_update_cart_item().
uc_product_update_cart_item in uc_product/uc_product.module
Update information about a specific item in current cart.

File

uc_cart/uc_cart.module, line 2021

Code

function uc_cart_remove_item($nid, $cid = NULL, $data = array()) {
  if (empty($nid)) {
    return;
  }
  $cart_id = !(is_null($cid) || empty($cid)) ? $cid : uc_cart_get_id();
  db_query("DELETE FROM {uc_cart_products} WHERE cart_id = '%s' AND nid = %d AND data = '%s'", $cart_id, $nid, serialize($data));
  cache_clear_all();
}