clsUser::insertShippingAddress($shippingAddress, $userid);
            }
            $_SESSION["sess_guest_login_id"] = $userId;
            $_SESSION["sess_guest_username"] = $username;
            $_SESSION["sess_guest_password"] = $guest_password;
            // Register user ends
        }
        //else ends
        // set user session
        $_SESSION["sess_userid"] = $userId;
        // Update Cart with User Id
        clsUser::updateCartGuest(session_id(), $userId);
    }
    echo 'guest user sucess';
    exit;
} elseif (isset($_SESSION['sess_userid'])) {
    //update shipping address
    $userId = $_SESSION["sess_userid"];
    if ($chkSaveShippingAddress == 1) {
        if (clsUser::chkUserShippingAddress($userId) == 1) {
            clsUser::updateShippingAddress($shippingAddress, $userId);
        } else {
            clsUser::insertShippingAddress($shippingAddress, $userId);
        }
    }
    clsUser::updateBillingAddress($billingAddress, $userId);
    echo 'user shipping address';
    exit;
}
echo 'error';
exit;