You are here

public function UcAjaxCart::removeItemFromCart in Ubercart AJAX Cart 6.2

Same name and namespace in other branches
  1. 7.2 uc_ajax_cart.extender.inc \UcAjaxCart::removeItemFromCart()

File

./uc_ajax_cart.php, line 25

Class

UcAjaxCart

Code

public function removeItemFromCart($nid, $data) {
  $content = $this
    ->getCartContents();
  $product = node_load($nid);
  uc_product_load($product);
  if ($product->type == 'product_kit') {
    foreach ($data as $nid => $product) {
      uc_cart_remove_item($nid, uc_cart_get_id(), $product->data);
    }
  }
  else {
    uc_cart_remove_item($nid, uc_cart_get_id(), $data);
  }
}