Merge branch 'alexandre-braderie' into develop
This commit is contained in:
commit
5c9f1e5d29
@ -257,8 +257,7 @@ class AdminProducts extends AdminTab
|
||||
|
||||
// Récupération de tous les produits de la catégorie ordonée
|
||||
// selon la position de la sous-catégorie puis de la position dans la sous catégorie et sinon par id_product
|
||||
$products = Db::getInstance()->ExecuteS('
|
||||
(
|
||||
$first_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
LEFT JOIN `'._DB_PREFIX_.'category` c ON (c.id_parent = cp.id_category)
|
||||
@ -267,9 +266,8 @@ class AdminProducts extends AdminTab
|
||||
WHERE cp.id_category ='.(int)$this->_category->id.'
|
||||
AND cp2.id_product IS NOT NULL
|
||||
ORDER BY c.position, cp2.position
|
||||
)
|
||||
UNION
|
||||
(
|
||||
');
|
||||
$second_products = Db::getInstance()->ExecuteS('
|
||||
SELECT cp.*
|
||||
FROM `'._DB_PREFIX_.'category_product` cp
|
||||
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
|
||||
@ -286,9 +284,9 @@ class AdminProducts extends AdminTab
|
||||
)
|
||||
)
|
||||
ORDER BY cp.id_product
|
||||
)
|
||||
');
|
||||
|
||||
$products = array_merge($first_products,$second_products);
|
||||
// Update des postions
|
||||
foreach ($products as $key => $product) {
|
||||
if ($key == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user