You are here

function uc_ajax_cart_remove_item in Ubercart AJAX Cart 6.2

Same name and namespace in other branches
  1. 7.2 uc_ajax_cart.module \uc_ajax_cart_remove_item()
1 call to uc_ajax_cart_remove_item()
uc_ajax_cart_callback in ./uc_ajax_cart.module

File

./uc_ajax_cart.module, line 128

Code

function uc_ajax_cart_remove_item($nid, $data) {
  $cart = new UcAjaxCart();
  try {
    $cart
      ->removeItemFromCart($nid, $data);
  } catch (NoProductException $ex) {
    drupal_set_message(t('No valid product'));
  } catch (CartException $ex) {
    foreach ($ex
      ->getMessages() as $message) {
      drupal_set_message($message, 'warning');
    }
  }
}