437 lines
18 KiB
PHP
437 lines
18 KiB
PHP
<?php
|
|
/*
|
|
+--------------------------------------------------------------------------
|
|
| CubeCart 4
|
|
| ========================================
|
|
| CubeCart is a registered trade mark of Devellion Limited
|
|
| Copyright Devellion Limited 2006. All rights reserved.
|
|
| Devellion Limited,
|
|
| 5 Bridge Street,
|
|
| Bishops Stortford,
|
|
| HERTFORDSHIRE.
|
|
| CM23 2JU
|
|
| UNITED KINGDOM
|
|
| http://www.devellion.com
|
|
| UK Private Limited Company No. 5323904
|
|
| ========================================
|
|
| Web: http://www.cubecart.com
|
|
| Email: info (at) cubecart (dot) com
|
|
| License Type: CubeCart is NOT Open Source Software and Limitations Apply
|
|
| Licence Info: http://www.cubecart.com/site/faq/license.php
|
|
+--------------------------------------------------------------------------
|
|
| viewCat.inc.php
|
|
| ========================================
|
|
| Display the Current Category
|
|
+--------------------------------------------------------------------------
|
|
*/
|
|
if (!defined('CC_INI_SET')) die("Access Denied");
|
|
|
|
// include lang file
|
|
$lang = getLang("includes".CC_DS."content".CC_DS."viewCat.inc.php");
|
|
$page = (isset($_GET['page'])) ? sanitizeVar($_GET['page']) : 0;
|
|
$view_cat = new XTemplate ("content".CC_DS."viewCat.tpl");
|
|
$view_cat->assign("LANG_DIR_LOC", $lang['viewCat']['location']);
|
|
|
|
////////////////////////
|
|
// BUILD SUB CATEGORIES
|
|
////////////////////////
|
|
|
|
if (isset($_GET['catId'])) {
|
|
$_GET['catId'] = sanitizeVar($_GET['catId']);
|
|
## build query
|
|
$emptyCat = ($config['show_empty_cat']==true) ? '' : ' AND noProducts >= 1';
|
|
$query = "SELECT * FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_father_id = ".$db->mySQLSafe($_GET['catId'])." AND hide = '0'".$emptyCat." ORDER BY priority,cat_name ASC";
|
|
|
|
## get category array in foreign innit
|
|
$resultsForeign = $db->select("SELECT cat_master_id as cat_id, cat_name FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '" . LANG_FOLDER . "'");
|
|
|
|
## query database
|
|
$subCategories = false;
|
|
$subCategories = $db->select($query);
|
|
|
|
|
|
}
|
|
|
|
if (isset($_GET['catId']) && $_GET['catId']>0 && $subCategories == true) {
|
|
## loop results
|
|
for ($i=0; $i<count($subCategories); $i++) {
|
|
if (is_array($resultsForeign)) {
|
|
for ($k=0; $k<count($resultsForeign); $k++) {
|
|
if ($resultsForeign[$k]['cat_id'] == $subCategories[$i]['cat_id']) {
|
|
$subCategories[$i]['cat_name'] = $resultsForeign[$k]['cat_name'];
|
|
}
|
|
}
|
|
}
|
|
|
|
if (empty($subCategories[$i]['cat_image'])) {
|
|
$view_cat->assign("IMG_CATEGORY", $GLOBALS['rootRel']."skins/". SKIN_FOLDER . "/styleImages/catnophoto.gif");
|
|
} else {
|
|
$view_cat->assign("IMG_CATEGORY", imgPath($subCategories[$i]['cat_image'], true, 'rel'));
|
|
}
|
|
|
|
$view_cat->assign("TXT_LINK_CATID",$subCategories[$i]['cat_id']);
|
|
$view_cat->assign("TXT_CATEGORY", validHTML($subCategories[$i]['cat_name']));
|
|
$view_cat->assign("NO_PRODUCTS", $subCategories[$i]['noProducts']);
|
|
$view_cat->parse("view_cat.sub_cats.sub_cats_loop");
|
|
}
|
|
$view_cat->parse("view_cat.sub_cats");
|
|
}
|
|
|
|
////////////////////////////
|
|
// BUILD PRODUCTS
|
|
////////////////////////////
|
|
|
|
|
|
## New! Product sorting by field
|
|
$allowedSort = array('price', 'description', 'name', 'productCode', 'date_added');
|
|
if (isset($_GET['sort_by']) && in_array($_GET['sort_by'], $allowedSort)) {
|
|
switch ($_GET['sort_order']) {
|
|
case 'high':
|
|
$orderType = 'DESC';
|
|
$orderText = '&uarr';
|
|
$sortIcon = 'bullet_arrow_up.gif';
|
|
break;
|
|
case 'low':
|
|
$orderType = 'ASC';
|
|
$orderText = '&darr';
|
|
$sortIcon = 'bullet_arrow_down.gif';
|
|
break;
|
|
default:
|
|
$orderType = 'ASC';
|
|
$sortIcon = 'bullet_arrow_down.gif';
|
|
}
|
|
$orderSort = sprintf(' ORDER BY %s %s', $_GET['sort_by'], $orderType);
|
|
} else {
|
|
if ($config['cat_newest_first']) {
|
|
$orderSort = sprintf(' ORDER BY date_added DESC, name ASC');
|
|
} else {
|
|
$orderSort = sprintf(' ORDER BY name ASC');
|
|
}
|
|
}
|
|
|
|
## build query
|
|
if (!empty($_REQUEST['searchStr']) || !empty($_REQUEST['priceMin']) || !empty($_REQUEST['priceMax'])) {
|
|
|
|
/* LOG SEARCH PHRASE */
|
|
$searchwords = split ( "[ ,]", sanitizeVar($_REQUEST['searchStr']));
|
|
foreach ($searchwords as $word) {
|
|
$searchArray[] = $word;
|
|
}
|
|
|
|
$noKeys = count($searchArray);
|
|
for ($i=0; $i<$noKeys; $i++) {
|
|
$ucSearchTerm = strtoupper($searchArray[$i]);
|
|
|
|
if (($ucSearchTerm !== 'AND') && ($ucSearchTerm !== 'OR')) {
|
|
## Uppercase the search string
|
|
|
|
$searchQuery = "SELECT id FROM ".$glob['dbprefix']."CubeCart_search WHERE searchstr='".$ucSearchTerm."'";
|
|
$searchLogs = $db->select($searchQuery);
|
|
|
|
$insertStr['searchstr'] = $db->mySQLsafe($ucSearchTerm);
|
|
$insertStr['hits'] = $db->mySQLsafe(1);
|
|
$updateStr['hits'] = "hits+1";
|
|
|
|
if($searchLogs == TRUE) {
|
|
$db->update($glob['dbprefix']."CubeCart_search",$updateStr,"id=".$searchLogs[0]['id'],$quote = "");
|
|
} elseif(!empty($_GET['searchStr'])) {
|
|
$db->insert($glob['dbprefix']."CubeCart_search",$insertStr);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* SPIFFING NEW SEARCH FUNCTIONALITY - Version 1.1 */
|
|
$indexes = $db->getFulltextIndex('inventory', 'I'); //array('inventory', 'inv_lang'));
|
|
|
|
if (!empty($_REQUEST['priceMin']) && is_numeric($_REQUEST['priceMin'])) $where[] = sprintf("I.price >= %s", $_REQUEST['priceMin']);
|
|
if (!empty($_REQUEST['priceMax']) && is_numeric($_REQUEST['priceMax'])) $where[] = sprintf("I.price <= %s", $_REQUEST['priceMax']);
|
|
|
|
if (isset($_REQUEST['inStock'])) $where[] = "((I.useStockLevel = 0) OR (I.useStockLevel = 1 AND I.stock_level > 0))";
|
|
|
|
if (!empty($_REQUEST['category'])) {
|
|
if (is_array($_REQUEST['category'])) {
|
|
foreach ($_REQUEST['category'] as $cat_id) {
|
|
if (is_numeric($cat_id)) $cats[] = $cat_id;
|
|
}
|
|
$where[] = sprintf("I.cat_id IN (%s)", implode(',', $cats));
|
|
} else if (is_numeric($_REQUEST['category'])) {
|
|
$where[] = sprintf("I.cat_id = '%d'", $_REQUEST['category']);
|
|
}
|
|
}
|
|
|
|
$where[] = "I.disabled = '0'";
|
|
$whereString = sprintf('AND %s', implode(' AND ', $where));
|
|
|
|
if (is_array($indexes)) {
|
|
|
|
switch ($config['searchMode']) {
|
|
case 'boolean':
|
|
$mode = ' IN BOOLEAN MODE';
|
|
break;
|
|
case 'expansion':
|
|
$mode = ' WITH QUERY EXPANSION';
|
|
break;
|
|
default:
|
|
$mode = '';
|
|
}
|
|
if (!empty($_REQUEST['searchStr'])) {
|
|
if (!empty($orderSort)) {
|
|
$orderSort = str_replace(' ORDER BY', '', $orderSort);
|
|
} else {
|
|
$orderSort = 'SearchScore DESC';
|
|
}
|
|
$matchString = sprintf("MATCH (%s) AGAINST(%s%s)", implode(',', $indexes), $db->mySQLsafe($_REQUEST['searchStr']), $mode);
|
|
$search = sprintf("SELECT I.*, %2\$s AS SearchScore FROM %1\$sCubeCart_inventory AS I LEFT JOIN %1\$sCubeCart_category AS C ON C.cat_id = I.cat_id WHERE I.cat_id > 0 AND C.hide = '0' AND (%2\$s) >= %4\$f %3\$s ORDER BY %5\$s", $glob['dbprefix'], $matchString, $whereString, 0.5, $orderSort);
|
|
} else {
|
|
$search = sprintf("SELECT I.* FROM %sCubeCart_inventory AS I WHERE I.cat_id > 0 %s %s", $glob['dbprefix'], $whereString, $orderSort);
|
|
}
|
|
$productListQuery = $search;
|
|
}
|
|
|
|
$productResults = $db->select($productListQuery, $config['productPages'], $page);
|
|
|
|
## FALLBACK - If search doesn't work, try the old v3 style search
|
|
if (!$productResults) {
|
|
$searchwords = split ( "[ ,]", sanitizeVar($_REQUEST['searchStr']));
|
|
foreach ($searchwords as $word) {
|
|
$searchArray[] = $word;
|
|
}
|
|
$noKeys = count($searchArray);
|
|
$like = '';
|
|
for ($i=0; $i<$noKeys; $i++) {
|
|
## Uppercase the search string
|
|
$ucSearchTerm = strtoupper($searchArray[$i]);
|
|
|
|
if (($ucSearchTerm !== 'AND') && ($ucSearchTerm !== 'OR')) {
|
|
$like .= "(name LIKE '%".$searchArray[$i]."%' OR description LIKE '%".$searchArray[$i]."%' OR productCode LIKE '%".$searchArray[$i]."%') OR ";
|
|
|
|
## See if search terrm is in database
|
|
$searchQuery = "SELECT id FROM ".$glob['dbprefix']."CubeCart_search WHERE searchstr='".$ucSearchTerm."'";
|
|
$searchLogs = $db->select($searchQuery);
|
|
|
|
$insertStr = array(
|
|
'searchstr' => $db->mySQLsafe($ucSearchTerm),
|
|
'hits' => 1,
|
|
);
|
|
$updateStr = array(
|
|
'hits' => 'hits+1',
|
|
);
|
|
|
|
if ($searchLogs) {
|
|
$db->update($glob['dbprefix'].'CubeCart_search', $updateStr, 'id='.$searchLogs[0]['id'], '');
|
|
|
|
} else if (!empty($_REQUEST['searchStr'])) {
|
|
$db->insert($glob['dbprefix'].'CubeCart_search', $insertStr);
|
|
}
|
|
|
|
} else {
|
|
$like = substr($like, 0, strlen($like)-3);
|
|
$like .= $ucSearchTerm;
|
|
}
|
|
}
|
|
$like = substr($like, 0, strlen($like)-3);
|
|
$productListQuery = sprintf("SELECT * FROM %sCubeCart_inventory AS I WHERE disabled = '0' AND %s %s ORDER BY %s", $glob['dbprefix'], $like, $whereString, $orderSort);
|
|
$productResults = $db->select($productListQuery, $config['productPages'], $page);
|
|
}
|
|
|
|
} else if ($_GET['catId'] == 'saleItems' && $config['saleMode'] >= 1) {
|
|
$productListQuery = sprintf("SELECT C.cat_id, C.productId, I.productCode, I.quantity, I.description, I.image, I.price, I.name, I.popularity, I.sale_price, I.stock_level, I.useStockLevel FROM %1\$sCubeCart_cats_idx AS C INNER JOIN %1\$sCubeCart_inventory AS I ON C.productId = I.productId WHERE I.disabled = '0' AND I.sale_price > 0 AND C.cat_id > 0 GROUP BY I.productId %2\$s", $glob['dbprefix'], $orderSort);
|
|
} else {
|
|
$productListQuery = sprintf("SELECT C.cat_id, C.productId, I.productCode, I.quantity, I.description, I.image, I.price, I.name, I.popularity, I.sale_price, I.stock_level, I.useStockLevel FROM %1\$sCubeCart_cats_idx AS C INNER JOIN %1\$sCubeCart_inventory AS I ON C.productId = I.productId WHERE I.disabled = '0' AND C.cat_id = %2\$s GROUP BY I.productId %3\$s", $glob['dbprefix'], $db->mySQLSafe($_GET['catId']), $orderSort);
|
|
}
|
|
|
|
## Run query if we haven't already done a search
|
|
if (!$productResults) {
|
|
$productResults = $db->select($productListQuery, $config['productPages'], $page);
|
|
}
|
|
|
|
## Get different languages
|
|
if ($productResults && LANG_FOLDER !== $config['defaultLang']) {
|
|
for ($i=0;$i<count($productResults);$i++) {
|
|
if (($val = prodAltLang($productResults[$i]['productId'])) == true) {
|
|
$productResults[$i]['name'] = $val['name'];
|
|
$productResults[$i]['description'] = $val['description'];
|
|
}
|
|
}
|
|
}
|
|
$totalNoProducts = $db->numrows($productListQuery);
|
|
|
|
## Get current category info
|
|
if (isset($_GET['catId'])) {
|
|
if ($config['seftags']) {
|
|
if ($_GET['catId']>0) {
|
|
$currentCatQuery = "SELECT cat_metatitle, cat_metadesc, cat_metakeywords, cat_name, cat_father_id, cat_id, cat_image, cat_desc FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY priority,cat_name ASC";
|
|
$currentCat = $db->select($currentCatQuery);
|
|
|
|
$prevDirSymbol = $config['dirSymbol'];
|
|
$config['dirSymbol'] = ' - ';
|
|
$meta['siteTitle'] = getCatDir($currentCat[0]['cat_name'],$currentCat[0]['cat_father_id'], $currentCat[0]['cat_id'], false, true, $config['sefprodnamefirst'] ? FALSE : TRUE);
|
|
$config['dirSymbol'] = $prevDirSymbol;
|
|
|
|
$meta['metaDescription'] = strip_tags($config['metaDescription']);
|
|
$meta['sefSiteTitle'] = $currentCat[0]['cat_metatitle'];
|
|
$meta['sefSiteDesc'] = $currentCat[0]['cat_metadesc'];
|
|
$meta['sefSiteKeywords'] = $currentCat[0]['cat_metakeywords'];
|
|
|
|
} else if (strcmp($_GET['catId'], "saleItems") == 0) {
|
|
$meta['siteTitle'] = $lang['front']['boxes']['sale_items'];
|
|
$meta['metaDescription'] = strip_tags($config['metaDescription']);
|
|
}
|
|
} else if (is_numeric($_GET['catId'])) {
|
|
$currentCatQuery = "SELECT cat_name, cat_father_id, cat_id, cat_image, cat_desc FROM ".$glob['dbprefix']."CubeCart_category WHERE cat_id = ".$db->mySQLSafe($_GET['catId'])." ORDER BY priority,cat_name ASC";
|
|
$currentCat = $db->select($currentCatQuery);
|
|
}
|
|
|
|
# Get translations
|
|
$resultForeign = $db->select("SELECT cat_master_id as cat_id, cat_name, cat_desc FROM ".$glob['dbprefix']."CubeCart_cats_lang WHERE cat_lang = '".LANG_FOLDER."' AND cat_master_id = ".$db->mySQLSafe($_GET['catId']));
|
|
if ($resultForeign == true) {
|
|
$currentCat[0]['cat_name'] = $resultForeign[0]['cat_name'];
|
|
$currentCat[0]['cat_desc'] = $resultForeign[0]['cat_desc'];
|
|
}
|
|
}
|
|
|
|
if (!empty($currentCat[0]['cat_image'])) {
|
|
$view_cat->assign("IMG_CURENT_CATEGORY",imgPath($currentCat[0]['cat_image'], false, 'rel'));
|
|
$view_cat->assign("TXT_CURENT_CATEGORY",validHTML($currentCat[0]['cat_name']));
|
|
$view_cat->parse("view_cat.cat_img");
|
|
}
|
|
|
|
if (isset($_REQUEST['searchStr']) || isset($_REQUEST['priceMin']) || isset($_REQUEST['priceMax'])) {
|
|
$view_cat->assign("TXT_CAT_TITLE", $lang['viewCat']['search_results']);
|
|
$view_cat->assign("CURRENT_LOC", $config['dirSymbol'].$lang['viewCat']['search_results']);
|
|
|
|
} else if ($_GET['catId']=="saleItems" && $config['saleMode']>0) {
|
|
$view_cat->assign("TXT_CAT_TITLE", $lang['viewCat']['sale_items']);
|
|
$view_cat->assign("CURRENT_LOC", $config['dirSymbol'].$lang['viewCat']['sale_items']);
|
|
} else {
|
|
$view_cat->assign("TXT_CAT_TITLE", validHTML($currentCat[0]['cat_name']));
|
|
$view_cat->assign("CURRENT_LOC", getCatDir($currentCat[0]['cat_name'], $currentCat[0]['cat_father_id'], $currentCat[0]['cat_id'], true));
|
|
}
|
|
|
|
if (!empty($currentCat[0]['cat_desc'])) {
|
|
$view_cat->assign("TXT_CAT_DESC", $currentCat[0]['cat_desc']);
|
|
$view_cat->parse("view_cat.cat_desc");
|
|
}
|
|
|
|
$view_cat->assign("LANG_IMAGE", $lang['viewCat']['image']);
|
|
$view_cat->assign("LANG_DESC", $lang['viewCat']['description']);
|
|
$view_cat->assign("LANG_NAME", $lang['viewCat']['name']);
|
|
$view_cat->assign("LANG_PRICE", $lang['viewCat']['price']);
|
|
$view_cat->assign("LANG_DATE", $lang['viewCat']['date_added']);
|
|
|
|
$pagination = paginate($totalNoProducts, $config['productPages'], $page, "page");
|
|
|
|
if (!empty($pagination)) {
|
|
$view_cat->assign("PAGINATION", $pagination);
|
|
$view_cat->parse("view_cat.pagination_top");
|
|
$view_cat->parse("view_cat.pagination_bot");
|
|
}
|
|
|
|
## create the links for product sorting - need improving later
|
|
$sort_order = ($_GET['sort_order'] == 'high') ? 'low' : 'high';
|
|
switch($_GET['sort_by']) {
|
|
case 'name':
|
|
$view_cat->assign('SORT_NAME_SELECTED', ' selected="selected"');
|
|
break;
|
|
case 'price':
|
|
$view_cat->assign('SORT_PRICE_SELECTED', ' selected="selected"');
|
|
break;
|
|
case 'date_added':
|
|
$view_cat->assign('SORT_PRICE_SELECTED', ' selected="selected"');
|
|
break;
|
|
}
|
|
|
|
# $view_cat->assign('SORT_DIRECTION_TEXT', $orderText);
|
|
unset($_GET['sort_by'], $_GET['sort_order']);
|
|
|
|
$view_cat->assign('SORT_PROD_CODE', currentPage()."&sort_by=productCode&sort_order=".$sort_order);
|
|
$view_cat->assign('SORT_PRICE', currentPage()."&sort_by=price&sort_order=".$sort_order);
|
|
$view_cat->assign('SORT_DESC', currentPage()."&sort_by=description&sort_order=".$sort_order);
|
|
$view_cat->assign('SORT_NAME', currentPage()."&sort_by=name&sort_order=".$sort_order);
|
|
$view_cat->assign('SORT_DATE', currentPage()."&sort_by=date_added&sort_order=".$sort_order);
|
|
if (!empty($sortIcon) && file_exists('skins'.CC_DS.SKIN_FOLDER.CC_DS.'styleImages'.CC_DS.'icons'.CC_DS.$sortIcon)) {
|
|
$view_cat->assign('SORT_ICON', sprintf('<img src="%s", alt="" />', 'skins'.CC_DS.SKIN_FOLDER.CC_DS.'styleImages'.CC_DS.'icons'.CC_DS.$sortIcon));
|
|
}
|
|
|
|
## repeated region
|
|
if ($productResults) {
|
|
for ($i=0; $i<count($productResults); $i++) {
|
|
## alternate class
|
|
$view_cat->assign("CLASS",cellColor($i, $tdEven="tdEven", $tdOdd="tdOdd"));
|
|
|
|
$thumbRoot = imgPath($productResults[$i]['image'], $thumb=1, $path="root");
|
|
$thumbRootRel = imgPath($productResults[$i]['image'], $thumb=1, $path="rel");
|
|
|
|
if (file_exists($thumbRoot)) {
|
|
$view_cat->assign("SRC_PROD_THUMB", $thumbRootRel);
|
|
} else {
|
|
$view_cat->assign("SRC_PROD_THUMB", $GLOBALS['rootRel']."skins/". SKIN_FOLDER . "/styleImages/thumb_nophoto.gif");
|
|
}
|
|
|
|
$view_cat->assign("TXT_TITLE", validHTML($productResults[$i]['name']));
|
|
|
|
if (strlen($productResults[$i]['description']) > $config['productPrecis']) {
|
|
$view_cat->assign("TXT_DESC", substr(strip_tags($productResults[$i]['description']), 0, $config['productPrecis'])."…");
|
|
} else {
|
|
$view_cat->assign("TXT_DESC", $productResults[$i]['description']);
|
|
}
|
|
|
|
if (salePrice($productResults[$i]['price'], $productResults[$i]['sale_price']) == false) {
|
|
$view_cat->assign("TXT_PRICE", priceFormat($productResults[$i]['price'], true));
|
|
} else {
|
|
$view_cat->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($productResults[$i]['price'],true)."</span>");
|
|
}
|
|
$salePrice = salePrice($productResults[$i]['price'], $productResults[$i]['sale_price']);
|
|
|
|
$view_cat->assign("TXT_SALE_PRICE", priceFormat($salePrice,true));
|
|
|
|
if (isset($_GET['add']) && isset($_GET['quan'])) {
|
|
$view_cat->assign("CURRENT_URL", str_replace(array("&add=".$_GET['add'], "&quan=".$_GET['quan']), '', currentPage()));
|
|
|
|
} else {
|
|
$view_cat->assign("CURRENT_URL", currentPage());
|
|
}
|
|
|
|
if ($config['outofstockPurchase'] == true) {
|
|
$view_cat->assign("BTN_BUY", $lang['viewCat']['buy']);
|
|
$view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']);
|
|
$view_cat->parse("view_cat.productTable.products.buy_btn");
|
|
|
|
} else if ($productResults[$i]['useStockLevel'] == true && $productResults[$i]['stock_level']>0) {
|
|
$view_cat->assign("BTN_BUY", $lang['viewCat']['buy']);
|
|
$view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']);
|
|
$view_cat->parse("view_cat.productTable.products.buy_btn");
|
|
|
|
} else if ($productResults[$i]['useStockLevel'] == false) {
|
|
$view_cat->assign("BTN_BUY", $lang['viewCat']['buy']);
|
|
$view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']);
|
|
$view_cat->parse("view_cat.productTable.products.buy_btn");
|
|
}
|
|
|
|
$view_cat->assign("BTN_MORE", $lang['viewCat']['more']);
|
|
$view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']);
|
|
|
|
if ($productResults[$i]['stock_level']<1 && $productResults[$i]['useStockLevel'] == true && $productResults[$i]['digital'] == false) {
|
|
$view_cat->assign("TXT_OUTOFSTOCK", $lang['viewCat']['out_of_stock']);
|
|
} else {
|
|
$view_cat->assign("TXT_OUTOFSTOCK", '');
|
|
}
|
|
|
|
$view_cat->parse("view_cat.productTable.products");
|
|
}
|
|
|
|
$view_cat->assign("LANG_SORT", $lang['viewCat']['sort']);
|
|
$view_cat->parse("view_cat.productTable");
|
|
|
|
} else if (!$productResults && isset($_REQUEST['searchStr'])) {
|
|
$view_cat->assign("TXT_NO_PRODUCTS", sprintf($lang['viewCat']['no_products_match'], sanitizeVar($_REQUEST['searchStr'])));
|
|
$view_cat->parse("view_cat.noProducts");
|
|
|
|
} else {
|
|
$view_cat->assign("TXT_NO_PRODUCTS", $lang['viewCat']['no_prods_in_cat']);
|
|
$view_cat->parse("view_cat.noProducts");
|
|
}
|
|
|
|
$view_cat->parse("view_cat");
|
|
$page_content = $view_cat->text("view_cat");
|
|
?>
|