You are here

function uc_cart_user in Ubercart 6.2

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

Implements hook_user().

File

uc_cart/uc_cart.module, line 318

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);
      break;
  }
}