You are here

function uc_product_update_wishlist_item in UC Wish List 6

Same name and namespace in other branches
  1. 8 uc_wishlist.module \uc_product_update_wishlist_item()
  2. 7 uc_wishlist.module \uc_product_update_wishlist_item()

Update information about a specific item in current wish list.

1 call to uc_product_update_wishlist_item()
uc_wishlist_add_item in ./uc_wishlist.module
Adds an item to a user's wish list.

File

./uc_wishlist.module, line 432
Allows users to create public shopping/wish lists.

Code

function uc_product_update_wishlist_item($nid, $data = array(), $qty, $wid = NULL, $wpid = NULL) {
  if (!$nid) {
    return NULL;
  }
  $wid = $wid ? $wid : uc_wishlist_get_wid();
  if ($qty < 1) {
    $wpid = $wpid ? $wpid : $data['wpid'];
    uc_wishlist_remove_item($wpid);
  }
  else {
    db_query("UPDATE {uc_wishlist_products} SET qty = %d, changed = %d WHERE wpid = %d", $qty, time(), $wpid);
  }
}