Update api_products.class.php

This commit is contained in:
Laurent Destailleur 2022-05-01 12:23:02 +02:00 committed by GitHub
parent f187f4214a
commit a2ff15164f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,12 +189,10 @@ class Products extends DolibarrApi
$sql = "SELECT t.rowid, t.ref, t.ref_ext";
$sql .= " FROM ".$this->db->prefix()."product as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
if ($category > 0) {
$sql .= ", ".$this->db->prefix()."categorie_product as c";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields AS ef ON (ef.fk_object = t.rowid)";
$sql .= ' WHERE t.entity IN ('.getEntity('product').')';
if ($variant_filter == 1) {