$count_ids = "SELECT op.products_id, count(op.products_id) as count from ". TABLE_ORDERS_PRODUCTS . " op left join " . TABLE_PRODUCTS . " p on (op.products_id = p.products_id), " . TABLE_SUPPLIERS . " s where p.products_supplier_id = s.supplier_id and s.supplier_id = " . $manufacturers_id . " and op.orders_status = 1 group by op.products_id having count(op.products_id) >= 1";
ou dans mon index.php
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, 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 " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_PRODUCTS_TO_STATUS . " ps on p.products_id = ps.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . $HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . $languages_id ."' and p2c.categories_id = '" . $HTTP_GET_VARS['filter_id'] . "'";
Partager