createCart($_SESSION["sUser_id"]); if($_SESSION["sOnline"]!="Yes"){ $_SESSION["sOnline"] = "Shopping"; } }else{ // can I have the same shopping bag AFTER I log in please... if($_SESSION["sOnline"]=="Yes"){ // confirm the bag is good. if($db->getOne("SELECT user_id FROM shoppingCarts WHERE cart_id='{$_SESSION[sCart_id]}'")!=$_SESSION["sUser_id"]){ $db->query("UPDATE shoppingCarts SET user_id='{$_SESSION[sUser_id]}' WHERE cart_id='{$_SESSION[sCart_id]}'"); } } } $session=""; $session = new objector($_SESSION); print<<

Below is a list of the contents of your shopping bag. To remove an item, simply click the "Remove" checkbox for the item you wish to remove and click "Update" to continue.

If you would like to checkout and complete your order, simply click "Checkout" to continue.

eof; switch($action){ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //add //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// case"add": $store = new aStore($db,$config,"user"); // parse through the products... //parseArray($_GET); //parseArray($_SESSION); $quantity = $_GET['quantity']; $productGroupQuantity= $_GET['productGroupQuantity']; $options=$get->options; // first we check for groups... if($get->productGroupQuantity!=""){ $cart->addProductGroup($get->productGroup_id,$get->productGroupQuantity,$store); } $sql = ""; // now add individual products... if(is_array($quantity)){ foreach($quantity AS $product_id=>$theQuantity){ if($theQuantity!=0){ $theOptions = $options[$product_id]; $cart->addProduct($product_id,$theQuantity,$theOptions,$store); } } } $cart->printCart($_SESSION["sCart_id"]); break; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //update //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// case"update": $store = new aStore($db,$config,"user"); // parse through the products... //parseArray($_GET); //parseArray($_SESSION); $quantity = $get->quantity; $options=$get->options; $remove = $get->remove; // now add individual products... if(is_array($quantity)){ foreach($quantity AS $product_id=>$theQuantity){ if($theQuantity!=0){ $cart->addProduct($product_id,$theQuantity,$options,$store); } } } if(is_array($remove)){ foreach($remove as $product_id=>$garbage){ $cart->removeProduct($product_id,$_SESSION["sCart_id"]); } } $cart->printCart($_SESSION["sCart_id"]); break; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //default //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// default: //print the cart.... $cart->printCart($_SESSION["sCart_id"]); break; } print""; include("inc/foot.php"); function parseArray($theArray){ print""; } ?>