// search parametrs to advanced search if ($extraParametrsTemplate != null) { $callBackParam["extraParametrsTemplate"] = $extraParametrsTemplate; } if ($searchParamName != null) { $callBackParam["name"] = $searchParamName; } if ($rangePrice != null) { $callBackParam["price"] = $rangePrice; } $count = 0; $navigatorHtml = GetNavigatorHtml(_getUrlToNavigate($categoryID), CONF_PRODUCTS_PER_PAGE, 'prdSearchProductByTemplate', $callBackParam, $products, $offset, $count); $show_comparison = 0; $cc_products = count($products); for ($i = 0; $i < $cc_products; $i++) { $cat = catGetCategoryById($products[$i]["categoryID"]); $products[$i]["allow_products_comparison"] = $cat["allow_products_comparison"]; if ($products[$i]["allow_products_comparison"] == 1 && $categoryID == $products[$i]["categoryID"]) { $show_comparison++; } } if (CONF_PRODUCT_SORT == '1') { _sortSetting($smarty, _getUrlToSort($categoryID)); } //calculate a path to the category $smarty->assign("product_category_path", catCalculatePathToCategory($categoryID)); $smarty->assign("search_with_change_category_ability", 1); $smarty->assign("show_comparison", $show_comparison); $smarty->assign("catalog_navigator", $navigatorHtml); $smarty->assign("products_to_show_counter", count($products)); $smarty->assign("products_to_show", $products);
<?php $extraParametrsTemplate = null; $searchParamName = null; $rangePrice = null; if (!isset($_GET["categoryID"]) && isset($_GET["search_with_change_category_ability"])) { $smarty->assign("categories_to_select", $cats); } if (isset($_GET["categoryID"])) { $_GET["categoryID"] = (int) $_GET["categoryID"]; if (!catGetCategoryById($_GET["categoryID"])) { header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found"); die(ERROR_404_HTML); } else { if (isset($_GET["search_with_change_category_ability"])) { $smarty->assign("categories_to_select", $cats); } $getData = null; if (isset($_GET["advanced_search_in_category"])) { $extraParametrsTemplate = array(); $extraParametrsTemplate["categoryID"] = $_GET["categoryID"]; if (isset($_GET["search_name"])) { if (trim($_GET["search_name"]) != "") { $searchParamName = array($_GET["search_name"]); } } $rangePrice = array("from" => $_GET["search_price_from"], "to" => $_GET["search_price_to"]); $getData = ScanGetVariableWithId(array("param")); foreach ($getData as $optionID => $value) {
exit; } } else { echo "<div align=\"center\"><span style=\"color: #BB0000\">" . ERROR_FAILED_TO_UPLOAD_FILE . "</span></div>\n"; exit; } } //remove old picture... Redirect(ADMIN_FILE . "?categoryID=" . $pid . "&eaction=cat"); } Redirect(ADMIN_FILE . "?dpt=catalog&sub=products_categories&categoryID=" . $pid . "&expandCat=" . $pid); } else { //category edition from if (isset($_GET["categoryID"])) { //edit existing category $row = catGetCategoryById($_GET["categoryID"]); if (!$row) { //can't find category.... echo "<center><font color=BB0000>" . ERROR_CANT_FIND_REQUIRED_PAGE . "</font>\n<br><br>\n"; echo "</center>"; exit; } $title = ADMIN_CAT_EDITN; $n = $row["name"]; $t = $row["title"]; $d = html_spchars($row["description"]); $d2 = html_spchars($row["description2"]); $z = html_spchars($row["zapros"]); $meta_d = $row["meta_description"]; $meta_k = $row["meta_keywords"]; $picture = $row["picture"];
} else { $value = STRING_VALUE_IS_UNDEFINED; } } // $item = array( "name" => $option["name"], "value" => $value ); $products[$productIndex][$optionIndex] = $value; $existFlag = true; break; } } if (!$existFlag) { $products[$productIndex][$optionIndex] = STRING_VALUE_IS_UNDEFINED; } $productIndex++; } $optionIndex++; } $counta = count($products); if ($counta > 0) { $smarty->assign("product_category_path", catCalculatePathToCategory($products[0]["categoryID"])); $category = catGetCategoryById($products[0]["categoryID"]); if ($category) { $smarty->assign("category_description", $category["description"]); } } $smarty->assign("definedOptions", $definedOptions); $smarty->assign("products", $products); $smarty->assign("products_count", $counta); $smarty->assign("main_content_template", "comparison_products.tpl"); } $smarty->assign("compare_value", count($_SESSION["comparison"]));
{ if (CONF_USE_RATING == 1) { $sort_string = STRING_PRODUCT_SORTN; } else { $sort_string = STRING_PRODUCT_SORT; } $sort_string = str_replace("{ASC_NAME}", "<a href='" . $urlToSort . "&sort=name&direction=ASC'>" . STRING_ASC . "</a>", $sort_string); $sort_string = str_replace("{DESC_NAME}", "<a href='" . $urlToSort . "&sort=name&direction=DESC'>" . STRING_DESC . "</a>", $sort_string); $sort_string = str_replace("{ASC_PRICE}", "<a href='" . $urlToSort . "&sort=Price&direction=ASC'>" . STRING_ASC . "</a>", $sort_string); $sort_string = str_replace("{DESC_PRICE}", "<a href='" . $urlToSort . "&sort=Price&direction=DESC'>" . STRING_DESC . "</a>", $sort_string); $sort_string = str_replace("{ASC_RATING}", "<a href='" . $urlToSort . "&sort=customers_rating&direction=ASC'>" . STRING_ASC . "</a>", $sort_string); $sort_string = str_replace("{DESC_RATING}", "<a href='" . $urlToSort . "&sort=customers_rating&direction=DESC'>" . STRING_DESC . "</a>", $sort_string); $smarty->assign("string_product_sort", html_amp($sort_string)); } //get selected category info $category = catGetCategoryById($categoryID); $tabs_view = checkView($categoryID); if (!$category) { header("HTTP/1.0 404 Not Found"); header("HTTP/1.1 404 Not Found"); header("Status: 404 Not Found"); die(ERROR_404_HTML); } else { if (!$adminislog) { IncrementCategoryViewedTimes($categoryID); } if (isset($_GET["prdID"])) { if (isset($_POST["cart_" . $_GET["prdID"] . "_x"])) { $variants = array(); foreach ($_POST as $key => $val) { if (strstr($key, "option_select_hidden")) {