You are here

function _commerce_wishlist_create_wishlist in Commerce Wishlist 7.2

Creates a new commerce_wishlist entry for a user.

Note that this does not first check to see if a user already has a wishlist. Such validation is left up to the caller.

1 call to _commerce_wishlist_create_wishlist()
_commerce_wishlist_add_product in ./commerce_wishlist.module
Adds a product to the wishlist.

File

./commerce_wishlist.module, line 646
Provides the wishlist for use in Drupal Commerce.

Code

function _commerce_wishlist_create_wishlist($uid) {
  $wishlist = (object) array(
    'wishlist_id' => NULL,
    'uid' => $uid,
  );
  drupal_write_record('commerce_wishlist', $wishlist);
  return $wishlist;
}