include PROJECTPATH . "inc/libs/vitabytes/mailing.inc.php"; /* * Including models and controllers */ include PROJECTPATH . "inc/categories.inc.php"; include PROJECTPATH . "inc/shopobjects.inc.php"; include PROJECTPATH . "inc/session.inc.php"; include PROJECTPATH . "inc/cart.inc.php"; include PROJECTPATH . "inc/user.inc.php"; include PROJECTPATH . "inc/order.inc.php"; include PROJECTPATH . "inc/payment.inc.php"; foreach ($_POST as &$value) { if (!is_array($value)) { $value = strip_tags(htmlspecialchars($value)); } } foreach ($_GET as &$value) { $value = strip_tags(htmlspecialchars($value)); } /* * Setting up the menu */ if (unserialize(stripslashes($_COOKIE['menu'])) == NULL) { setcookie('menu', serialize(CategoriesCtl::GetCategories(CATEGORIES_ID)), time() + 7600); } $cart = CartCtl::Get(SessionCtl::GetSession()); $tpl->assign("menu", unserialize(stripslashes($_COOKIE['menu']))); $tpl->assign("cart", $cart); $tpl->assign("username", $_COOKIE['username']); $tpl->assign("sitename", SITE_NAME); $tpl->assign("request_uri", "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
* 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");
*/ $pages = array("cart"); /* * Controller routines */ $id_product = $_POST["id_product"]; $quantity = $_POST["quantity"]; $size_txt = $_POST["size_txt"]; $pic = $_POST["pic"]; if ($size_txt != "") { $price = $_POST["price"]; $name = $_POST["name"]; $short_description = $_POST["short_description"] . " - " . $size_txt; $res = CartCtl::Add(SessionCtl::GetSession(), $id_product, $quantity, $price, $name, $short_description, DEFAULT_LANGUAGE, "FREE_ELEMENT", 0, array(array("lang" => DEFAULT_LANGUAGE, "name" => "pic", "value" => $pic))); } else { $res = CartCtl::Add(SessionCtl::GetSession(), $id_product, $quantity, "price", "name", "short_description", DEFAULT_LANGUAGE, "PRODUCT", 0, array(array("lang" => DEFAULT_LANGUAGE, "name" => "pic", "value" => $pic))); } $tpl->assign("cart", $res); /* * Assignments to the engine */ $tpl->assign("content_pages", $pages); $tpl->assign("res", $res); /* * Output of the page */ $tpl->draw("header"); $tpl->draw("body"); $tpl->draw("menu"); $tpl->draw("head"); $tpl->draw("content");
* @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");