You are here

function uc_ajax_cart_remove_item in Ubercart AJAX Cart 7.2

Same name and namespace in other branches
  1. 6.2 uc_ajax_cart.module \uc_ajax_cart_remove_item()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 call to uc_ajax_cart_remove_item()
uc_ajax_cart_callback in ./uc_ajax_cart.module
@todo Please document this function.

File

./uc_ajax_cart.module, line 188

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');
    }
  }
}