Myst26 Posted March 4, 2014 Share Posted March 4, 2014 Bonjour, Actuellement sous la version 1.5.6.1 de Prestashop avec la gestion des stocks avancés. Il apparait que les produits s'affichent en doublon, triple,. quadruple. Apparement, cela viendrait d'une requete SQL de la classe Supplier SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, image_shop.`id_image`, il.`legend`, s.`name` AS supplier_name, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL 20 DAY)) > 0 AS new, m.`name` AS manufacturer_name FROM `ps_product` p INNER JOIN ps_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1) JOIN `ps_product_supplier` ps ON (ps.id_product = p.id_product AND ps.id_product_attribute = 0) LEFT JOIN `ps_product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = 5 AND pl.id_shop = 1 ) LEFT JOIN `ps_image` i ON (i.`id_product` = p.`id_product`) LEFT JOIN ps_image_shop image_shop ON (image_shop.id_image = i.id_image AND image_shop.id_shop = 1 AND image_shop.cover=1) LEFT JOIN `ps_image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = 5) LEFT JOIN `ps_supplier` s ON s.`id_supplier` = p.`id_supplier` LEFT JOIN `ps_manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` LEFT JOIN ps_stock_available stock ON (stock.id_product = p.id_product AND stock.id_shop = 1 ) WHERE ps.`id_supplier` = 76 AND product_shop.`active` = 1 AND product_shop.`visibility` IN ("both", "catalog") AND p.`id_product` IN ( SELECT cp.`id_product` FROM `ps_category_group` cg LEFT JOIN `ps_category_product` cp ON (cp.`id_category` = cg.`id_category`) INNER JOIN `ps_category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1 WHERE cg.`id_group` = 1 ) AND ((image_shop.id_image IS NOT NULL OR i.id_image IS NULL) OR (image_shop.id_image IS NULL AND i.cover=1)) ORDER BY name asc LIMIT 0,21 Le "LEFT JOIN ps_stock_available stock ON (stock.id_product = p.id_product AND stock.id_shop = 1, retournera toujours plusieurs entrées, car il y a plusieurs entrées avec stock.id_product.. d'où les doublons Je n'ai pas reussi, pour l'instant, à régler ce problème. Si quelqu'un a également ce problème? peut-il me le dire ? Merci Link to comment Share on other sites More sharing options...
Myst26 Posted March 10, 2014 Author Share Posted March 10, 2014 up Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now