* End of email - sending */ $id_order = $res["id_order"]; $session = $res["session"]; SessionCtl::SetSession($session); setcookie('cart', ""); $cart = array(); $res = OrderCtl::DoPayment($id_order, array("token" => $token)); if ($res["status"] == "Success") { header("Location:" . $res["redirect"]); } } elseif ($res["status"] == "error" and $res["message"] == "SHOPOBJECT_NOT_AVAILABLE") { $cart = CartCtl::Refresh(SessionCtl::GetSession()); foreach ($cart["contents"] as $prod) { if ($prod["type"] == "DELIVERY_COSTS") { $cart = CartCtl::Del(SessionCtl::GetSession(), $prod["id"]); } } $tpl->assign("cart", $cart); $tpl->assign("missing_id", $res["param"]); $pages = array("product_not_available"); } /* * Assignments to the engine */ $tpl->assign("content_pages", $pages); $tpl->assign("cart", $cart); /* * Output of the page */ $tpl->draw("header");
* @kaveh raji <*****@*****.**> */ /* * Init routine */ include "inc/init.inc.php"; /* * Defining the pages */ $pages = array("cart"); /* * Controller routines */ $del = $_GET["del"]; if ($del != "") { $cart = CartCtl::Del(SessionCtl::GetSession(), $del); $tpl->assign("cart", $cart); } if (count($cart["contents"]) == 0) { $cart = 0; } /* * Assignments to the engine */ $tpl->assign("content_pages", $pages); $tpl->assign("res", $cart); /* * Output of the page */ $tpl->draw("header"); $tpl->draw("body");