You are here

function uc_cart_get_id in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \uc_cart_get_id()
  2. 7.3 uc_cart/uc_cart.module \uc_cart_get_id()

Return the unique cart_id of the user, sid for anonymous and uid for logged in users.

8 calls to uc_cart_get_id()
hook_update_cart_item in docs/hooks.php
Handle requests to update a cart item.
uc_2checkout_form in payment/uc_2checkout/uc_2checkout.module
uc_cart_add_item in uc_cart/uc_cart.module
Adds an item to a user's cart.
uc_cart_complete_sale in uc_cart/uc_cart.module
Completes a sale, including adjusting order status and creating user account.
uc_cart_get_contents in uc_cart/uc_cart.module
Grab the items in a shopping cart for a user.

... See full list

File

uc_cart/uc_cart.module, line 1868

Code

function uc_cart_get_id() {
  global $user;
  if ($user->uid) {
    return $user->uid;
  }
  elseif ($sid = session_id()) {
    return $sid;
  }

  // What to do if neither of these work? -RS
}