0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); require(DIR_WS_INCLUDES . 'template_top.php'); // default page // $shape=$_REQUEST[shape]; if(!isset($cPath)) $cPath=1; $condition = ''; if(isset($cPath)) { if(!empty($_REQUEST['shape'])) { $shape = array_filter($_REQUEST['shape']); if(count($shape)>0) { $shapeArr = array(); foreach($shape as $c) { $shapeArr[] = "'".$c."'"; } $shape = implode(',',$shapeArr); $condition .= " AND p.d_shape in ($shape)"; } $listing_sql = "select p.products_image, pd.products_name, p.products_id, p.products_price, p.sku, p.d_shape, p.d_carat, p.d_colour, p.d_clarity, p.d_cut, p.d_report, p.d_origin, p.d_fluorescene, p.d_polish, p.d_symmetry, p.d_depth, p.d_measurements, p.d_table, p.lw_ratio, p.d_collection,IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '1' $condition order by pd.products_name"; } else { $listing_sql = "select p.products_image, pd.products_name, p.products_id, p.products_price, p.sku, p.d_shape, p.d_carat, p.d_colour, p.d_clarity, p.d_cut, p.d_report, p.d_origin, p.d_fluorescene, p.d_polish, p.d_symmetry, p.d_depth, p.d_measurements, p.d_table, p.lw_ratio, p.d_collection,IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '1' order by pd.products_name"; } } $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); // This sets all the attribute arrays like shape_array, color_array etc. $attrArr = simpleAttributes(); $shape=$_REQUEST[shape]; ?>
We're here to help! Call us at
713-344-1422