remove($_REQUEST['id']); session_unregister("resultprice".$_REQUEST['id']); session_unregister("format".$_REQUEST['id']); break; case "empty" : $_SESSION['cart']->init(); break; case "recalc" : update_qty($_POST); break; } $_SESSION['cart']->cleanup(); $_SESSION['cart']->recalc_total(); } $qid = get_cart_items(); include("$CFG->templatedir/header.php"); include("templates/shopping_cart.php"); include("$CFG->templatedir/footer.php"); /****************************************************************************** * FUNCTIONS *****************************************************************************/ function update_qty(&$form) { /* update the product quantities, we are expecting them in the HTTP_POST_VARS * variable because the form does a POST. the quantities are in an array * called $qty[] and the corresponding product id's are in $id[] */ //global $SESSION; foreach ($form['id'] as $i => $productid) { $qty = $form['qty'][$i]; $_SESSION['cart']->set($productid, $qty); } } ?>