You are here

function uc_cart_user in Ubercart 5

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

Implementation of hook_user().

File

uc_cart/uc_cart.module, line 424

Code

function uc_cart_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'load':

      // Fall through if this a new user load prior to checkout.
      if (request_uri() != '/user/register?destination=cart/checkout' || $user->uid == 0) {
        break;
      }
    case 'login':

      // Add items from an anonymous cart to a user's permanent cart on login.
      uc_cart_login_update($user->uid, session_id());
      break;
  }
}