\n"; } else { // we SET the SESSION[tempID] later... } ///*** add to pageErrors object if ($tempId == '') { // if tempID is STILL blank... // do nothing - there will just be no items in cart // THIS SHOULD CHANGE! we should show some sort of processing arror if there is no tempID // echo "

Unexpected error - tempID is blank!!! (not found in GET or SESSION)

"; // echo "

We should really end the page here and now.

"; } else { //echo "

Temp Invoice Num(tempID): <" . $tempID . ">

"; } // place tempID in Session[tempInvoiceID] var, so that we can get it if we come back to this page $_SESSION['tempInvoiceID'] = $tempId; // process condition where quantities have been changed and database must be updated // we need to take all 'txtItemXXX' vars from SESSION and put them into POST // because $cart->updateItemQuantities uses the var values in POST $prefix = 'txtItem'; $i = 1; while (isset($_SESSION[$prefix . 'Qty' . $i])) { $_POST[$prefix . 'Qty' . $i] = $_SESSION[$prefix . 'Qty' . $i]; $_POST[$prefix . 'SaveQty' . $i] = $_SESSION[$prefix . 'SaveQty' . $i]; $_POST[$prefix . 'Number' . $i] = $_SESSION[$prefix . 'Number' . $i]; $i++; } $result = $cart->updateItemQuantities($tempId, $m_numitems, $e); if (defined(CART_NUMITEMS_LIMIT) && CART_NUMITEMS_LIMIT > 0) { if ($m_numitems > CART_NUMITEMS_LIMIT) { // set up for CheckErrors //// $_GET['numitems'] = $m_numitems; //// $_GET['err'] = 'NumItems'; $e->add("Number of items in cart ($m_numitems) is greater than maximum allowed (" . CART_NUMITEMS_LIMIT . ")!"); } } // process condition where coupon code has been set and database must be updated if (isset($_POST['txtCouponCode'])) { $couponCode = $_POST['txtCouponCode']; $_SESSION['txtCouponCode'] = $couponCode; } elseif (isset($_SESSION['txtCouponCode'])) { $couponCode = $_SESSION['txtCouponCode']; } // if DELETE ITEM button hit, URL param 'deleteLineID' will be set // txtItemNumberXX will relate to same lineID, where XX=lineID // itemID will then be the value of txtItemNumberXX POST if (isset($_GET['deletelineID'])) { $lineId = intval($_GET['deletelineID']); $itemId = $_POST['txtItemNumber' . $lineId]; $cart->deleteTempLineitem($tempId, $itemId, $e); // TODO: check for success of this function /* * delete any SESSION vars associated with this line item, because we may have done a * PostToSessionVars before getting here. * don't know if it really matters if we clean this up or not. */ unset($_SESSION['txtItemQty' . $lineId]); unset($_SESSION['txtItemSaveQty' . $lineId]); unset($_SESSION['txtItemNumber' . $lineId]); } // // modify some session variables // // if the state or country has not been set by the SESSION yet, then set explicitly if (!isset($_SESSION['lstCountry'])) $_SESSION['lstCountry'] = STR_COUNTRY_ORIGIN; if (!isset($_SESSION['lstState'])) $_SESSION['lstState'] = STR_STATE_NONE; // fix the ShipMethod // 2006.01.03 chrisl - set this for no ship method choosing - // this needs to be set so that the cart show will function properly, without having to choose a shipmethod ////$_SESSION['txtShipMethod'] = "normal"; // set the ship method based on the country chosen if (STR_COUNTRY_ORIGIN == $_SESSION['lstCountry']) { // interpret as US - use lstShipMethod_domestic's value $_SESSION['txtShipMethod'] = $_SESSION['lstShipMethod_domestic']; } else { // country other than US - use lstShipMethod_global $_SESSION['txtShipMethod'] = $_SESSION['lstShipMethod_global']; } if ('' == $_SESSION['txtShipMethod']) $_SESSION['txtShipMethod'] = STR_SHIPMETHOD_NONE; CheckErrors($e); // checks errors passed in on URL and adds them to $errs object, if any // take care of any Coupons that might be indicated by POST vars $cart->makeCouponDiscounts($tempId, $couponCode, $e); // set up error markup, if any TODO this should change: do it inline $cartErrors = ($e->count() > 0) ? "
" . $e->simple_text() . "
" : ''; // // // // // // // // // include("_head.cart.php"); /* custom javascript for this page */ ?> ' . "DEBUG extra stuff here
" . ''; } ?>

Cart Contents

displayCart $cartSpec = array( "mode" => "show", "invoiceID" => $tempId, "rateTax" => -1, // set for shipping info "rateinfo" => CartUtils::GetShippingRateInfo(), "country" => $_SESSION['lstCountry'], "state" => $_SESSION['lstState'], "shipmethod" => $_SESSION['txtShipMethod'], ); $format = array( 'classHeader' => 'cartheader', 'classCell' => 'cartcell', ); $cart->displayCart($cartSpec, $format); // sets $cartinfo['shipinfo'] structure ?>


Enter a coupon code here if you have it:  


For help or enquiries, please e-mail em_orders