0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) { $specials_index_query = "select p.products_id, p.products_image, pd.products_name, p.master_categories_id, p.product_is_always_free_shipping, pd.products_description from (" . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id ) where p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = 1 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; } else { // get all products and cPaths in this subcat tree $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit); if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) { // build products-list string to insert into SQL query foreach($productsInCategory as $key => $value) { $list_of_products .= $key . ', '; } $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma $specials_index_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id, p.product_is_always_free_shipping, pd.products_description from (" . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id ) where p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1' and s.status = '1' and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and p.products_id in (" . $list_of_products . ")"; } } if ($specials_index_query != '') $specials_index = $db->ExecuteRandomMulti($specials_index_query, MAX_DISPLAY_SPECIAL_PRODUCTS_INDEX); $row = 0; $col = 0; $list_box_contents = array(); $title = ''; $num_products_count = ($specials_index_query == '') ? 0 : $specials_index->RecordCount(); // show only when 1 or more if ($num_products_count > 0) { if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS == 0 ) { $col_width = floor(100/$num_products_count); } else { $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS); } $list_box_contents = array(); while (!$specials_index->EOF) { if (!isset($productsInCategory[$specials_index->fields['products_id']])) $productsInCategory[$specials_index->fields['products_id']] = zen_get_generated_category_path_rev($specials_index->fields['master_categories_id']); $ps_dd=true; $feat_sql=$db->Execute("select * from ".TABLE_FEATURED." where products_id=".$specials_index->fields['products_id']); if($feat_sql->RecordCount()>0){ $pf_dd=true; }else{ $pf_dd=false; } if($specials_index->fields['product_is_always_free_shipping']){ $free_dd=true; }else{ $free_dd=false; } if($ps_dd&&$pf_dd&&$free_dd){ $dd='Sale Free shipping'; } else if(($ps_dd&&$pf_dd)||($pf_dd&&$free_dd)||($ps_dd&&$free_dd)){ if($ps_dd&&$pf_dd){ $dd='Sale '; }else if($pf_dd&&$free_dd){ $dd=' Free shipping'; }else if($ps_dd&&$free_dd){ $dd='Sale Free shipping'; } } else if($ps_dd){ $dd='Sale'; } else if($pf_dd){ $dd=''; } else if($free_dd){ $dd='Free shipping'; } else{ $dd=''; } $products_img = (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . ''); $products_name = '