if(!empty($conf->global->MAIN_MULTILANGS))$sql.=', pl.label as labelm, pl.description as descriptionm';
$sql.=' FROM '.MAIN_DB_PREFIX.'product as p';
$sql.=' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON p.rowid = cp.fk_product';
if(!empty($conf->global->MAIN_MULTILANGS))$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang)."'";
$sql.=' WHERE p.entity IN ('.getEntity("product",1).')';
$sql.=' WHERE p.entity IN ('.getEntity('product',1).')';
if(!empty($search_categ)||!empty($catid))$sql.=' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";// We'll need this table joined to the select in order to filter by categ
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
// multilang
if($conf->global->MAIN_MULTILANGS)// si l'option est active
{
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang()."'";
}
if(!empty($conf->global->MAIN_MULTILANGS))$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang()."'";
$sql.=' WHERE p.entity IN ('.getEntity('product',1).')';