session_unregister($_SESSION["sess_artistid"]);
 }
 if (isset($_SESSION["sess_affiliateid"]) and $_SESSION["sess_affiliateid"] != "") {
     // Logging OutSeller  from same window
     session_unregister($_SESSION["sess_artistid"]);
 }
 // End check
 /*---------------Multicart 2.0 Upgradation------------------*/
 /*-------function call to manage the different sessions--------*/
 manageSession(3);
 /*---------------Multicart 2.0 Upgradation------------------*/
 if (!isVisitorCartEmpty(session_id())) {
     mergeVisitorCartToUserCart(session_id(), $row["user_id"]);
 }
 // Check Gift Products Exists in Cart  // Then delete NON gift Products
 if (checkGiftProductsExistsinCart($row["user_id"])) {
     cartClearDigital($row["user_id"]);
 }
 if ($wishMessage == 'Product added successfully!') {
     header("Location:" . SITE_URL . "/mywishlist.php");
     exit;
 }
 if ($action != "") {
     switch ($action) {
         case "checkout":
             header("Location:viewcart.php?action=checkout");
             exit;
             break;
         case "postartistfeedback":
             header("Location:postartistfeedback.php?artistid={$artistid}&productid={$productid}");
             exit;
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";
include_once "classes/cls_products.php";
if (get_magic_quotes_gpc()) {
    $_POST = array_map('stripslashes_deep', $_POST);
    $_GET = array_map('stripslashes_deep', $_GET);
    $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
if (isset($_SESSION["sess_userid"]) and $_SESSION["sess_userid"] != "") {
    $userid = $_SESSION["sess_userid"];
}
//echo $userid;
if (checkGiftProductsExistsinCart($userid)) {
    cartClearDigital($userid);
}
$_SESSION["sess_addresses_collected"] = false;
if (isset($_GET["msg"]) and $_GET["msg"] != "") {
    $msg = $_GET["msg"];
    switch ($msg) {
        case "updateqty":
            $message = "Item already present in the cart! Please update the quantity!<br>";
            break;
        case "cart_error_nondigital":
            $message = "Since the cart contains digital product/gift certificate adding a non digital product is not possible !!<br>";
            break;
        case "cart_error_digital":
            $message = "Since the cart contains non digital product adding a digital product/gift certificate is not possible !!<br>";
            break;