Skip to content
Snippets Groups Projects
Commit 33098783 authored by Regis Houssin's avatar Regis Houssin
Browse files

Modification: les produits ne faisant pas partie d'une catégorie seront visible

parent 2f81defd
No related branches found
No related tags found
No related merge requests found
......@@ -69,10 +69,9 @@ class box_produits extends ModeleBoxes {
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= ", ".MAIN_DB_PREFIX."categorie as c";
$sql .= " WHERE cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = c.rowid AND c.visible = 1";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
$sql.= " WHERE IFNULL(c.visible,1)=1";
}
$sql .= " ORDER BY p.datec DESC";
$sql .= $db->plimit($max, 0);
......
......@@ -1955,14 +1955,13 @@ function get_each_prod()
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= ", ".MAIN_DB_PREFIX."categorie as ca";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
}
$sql.= " WHERE p.fk_product_type = 0";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= " AND cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = ca.rowid AND ca.visible = 1";
$sql.= " AND IFNULL(c.visible,1)=1";
}
$resql=$this->db->query($sql);
if ($resql)
......
......@@ -208,14 +208,13 @@ class Service
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp";
$sql .= ", ".MAIN_DB_PREFIX."categorie as ca";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid";
}
$sql.= " WHERE p.fk_product_type = 1";
if ($conf->categorie->enabled && !$user->rights->categorie->voir)
{
$sql .= " AND cp.fk_product = p.rowid";
$sql .= " AND cp.fk_categorie = ca.rowid AND ca.visible = 1";
$sql.= " AND IFNULL(c.visible,1)=1";
}
$resql=$this->db->query($sql);
if ($resql)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment