You are here

function commerce_wishlist_order_load in Commerce Wishlist 7.3

Loads the default wishlist order for the specified user.

Parameters

int $uid: The uid of the customer whose wishlist to load.

Return value

bool|object The fully loaded shopping cart order or FALSE if nonexistent.

7 calls to commerce_wishlist_order_load()
commerce_wishlist_block_view in ./commerce_wishlist.module
Implements hook_block_view().
commerce_wishlist_product_add in ./commerce_wishlist.module
Add a product to a wish list.
commerce_wishlist_product_added_to_cart in ./commerce_wishlist.module
Form submit handler: wishlist product added to the cart.
commerce_wishlist_product_remove in ./commerce_wishlist.module
Removes a product from a user's wish list.
commerce_wishlist_product_remove_line_item in ./commerce_wishlist.module
Removes a product from a user's wish list.

... See full list

File

./commerce_wishlist.module, line 854
Provides a wish list for use in Drupal Commerce.

Code

function commerce_wishlist_order_load($uid = 0) {
  if ($uid == 0) {
    global $user;
    $uid = $user->uid;
  }
  if ($uid == 0) {
    return FALSE;
  }

  // Retrieve the order ID for the specified user's current shopping cart.
  $order_id = commerce_wishlist_order_id($uid);

  // If a valid cart order ID exists for the user, return it now.
  if (!empty($order_id)) {
    return commerce_order_load($order_id);
  }
  return FALSE;
}