$sorting_data = xtc_db_fetch_array($sorting_query,true);
if (!$sorting_data['products_sorting'])
$sorting_data['products_sorting'] = 'p.products_date_added';
$sorting = ' ORDER BY '.$sorting_data['products_sorting'].' '.$sorting_data['products_sorting2'].' desc';
// We are asked to show only a specific category
if (GROUP_CHECK == 'true') {
$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
}
$listing_sql = "select DISTINCT p.products_fsk18,
p.products_shippingtime,
p.products_model,
pd.products_name,
p.products_ean,
p.products_price,
p.products_tax_class_id,
m.manufacturers_name,
p.products_quantity,
p.products_image,
p.products_weight,
pd.products_short_description,
pd.products_description,
p.products_id,
p.manufacturers_id,
p.products_price,
p.products_vpe,
p.products_vpe_status,
p.products_vpe_value,
p.products_discount_allowed,
p.products_tax_class_id
from ".TABLE_PRODUCTS_DESCRIPTION." pd, ".TABLE_MANUFACTURERS." m, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c, ".TABLE_PRODUCTS." p left join ".TABLE_SPECIALS." s on p.products_id = s.products_id
where p.products_status = '1'
and p.manufacturers_id = m.manufacturers_id
and m.manufacturers_id = '".(int) $_GET['manufacturers_id']."'
and p.products_id = p2c.products_id
and pd.products_id = p2c.products_id
".$group_check."
".$fsk_lock."
and pd.language_id = '".(int) $_SESSION['languages_id']."'
and p2c.categories_id = '".(int) $_GET['filter_id']."'".$sorting;
} else {