You are here

function uc_coupon_uc_update_cart_item in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 7.2 uc_coupon.module \uc_coupon_uc_update_cart_item()

Implements hook_uc_update_cart_item(). Remove a coupon from the order when the "Remove" button is clicked.

File

./uc_coupon.module, line 1887
Provides discount codes and gift certificates for Ubercart.

Code

function uc_coupon_uc_update_cart_item($nid, $data, $qty) {
  if (isset($data['code']) && $qty == 0) {
    uc_coupon_session_clear($data['code']);
    module_invoke_all('uc_coupon_remove', uc_coupon_find($data['code']));
  }
}