LeGhe Posted June 11, 2009 Share Posted June 11, 2009 C'est possible ça ? Link to comment Share on other sites More sharing options...
Patric Posted June 11, 2009 Share Posted June 11, 2009 Non, pas en natif. Et je ne connais aucun module pour ça. Link to comment Share on other sites More sharing options...
LeGhe Posted June 11, 2009 Author Share Posted June 11, 2009 Ca, c'est vraiment pas cool ( Link to comment Share on other sites More sharing options...
Patric Posted June 11, 2009 Share Posted June 11, 2009 Le meilleur moyen pour que ce soit possible un jour et que ce soit cool, c'est de poster ta demande dans le Feature Request (en anglais). N'hésite pas à détailler tes besoins. Link to comment Share on other sites More sharing options...
syl Posted January 22, 2010 Share Posted January 22, 2010 Aucune nouvelle à ce propos ??(dans mon cas les fabricants sont des auteurs de livres. Et quelques livres sont co écrits...) Link to comment Share on other sites More sharing options...
LeGhe Posted May 2, 2010 Author Share Posted May 2, 2010 Un début de solution, qui pourrait être propre :J'ai inséré une nouvelle table qui s'appelle ps_productXmanufacturer selon la structure suivante :id_product id_manufacturer3107 11593108 23453108 2346....Dans classes/manufacturer.php, on trouve, vers la ligne 249 des requêtes SQL que je n'arrive pas à modifier : /* Return only the number of products */ if ($getTotal) { $sql = ' SELECT p.`id_product` FROM `'._DB_PREFIX_.'product` p WHERE p.id_manufacturer = '.intval($id_manufacturer) .($active ? ' AND p.`active` = 1' : '').' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN (SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).')').' )'; $result = Db::getInstance()->ExecuteS($sql); return intval(sizeof($result)); } $sql = ' SELECT p.*, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate` FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'tax` t ON t.`id_tax` = p.`id_tax` LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.intval($id_lang).') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` WHERE p.`id_manufacturer` = '.intval($id_manufacturer).($active ? ' AND p.`active` = 1' : '').' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`) WHERE cg.`id_group` '.(!$cookie->id_customer ? '= 1' : 'IN (SELECT id_group FROM '._DB_PREFIX_.'customer_group WHERE id_customer = '.intval($cookie->id_customer).')').' ) ORDER BY '.(($orderBy == 'id_product') ? 'p.' : '').'`'.pSQL($orderBy).'` '.pSQL($orderWay).' LIMIT '.((intval($p) - 1) * intval($n)).','.intval($n); $result = Db::getInstance()->ExecuteS($sql); if (!$result) return false; if ($orderBy == 'price') Tools::orderbyPrice($result, $orderWay); return Product::getProductsProperties($id_lang, $result); } public function getProductsLite($id_lang) { return Db::getInstance()->ExecuteS(' SELECT p.`id_product`, pl.`name` FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).') WHERE p.`id_manufacturer` = '.intval($this->id)); } Plutôt que d'interroger la base product, comment peut-on le faire interroger la base productXmanufacturer ?On aurait en ce cas une solution pas trop moche pour avoir plusieurs manufacturers, ou plusieurs suppliers pour un même produit, non ?Ou je m'égare ? Link to comment Share on other sites More sharing options...
Thain Posted November 19, 2010 Share Posted November 19, 2010 Bonjour,j'ai eu le même cas, et j'ai trouvé une solution "satisfaisante". J'ai créé une catégorie que j'ai désactivée pour la rendre invisible et j'ai utilisé l'astuce d'Amaury pour que produit reste actif. (http://www.prestashop.com/forums/viewthread/65700/integration/rendre_invisible_le_produits_tout_en_gardant_sa_fiche_accessible/ ). Ainsi, j'ai dupliqué l'article en choisissant un autre fabricant, et j'ai fait un robot.txt pour ne pas que cette page dupliquée soit référencée.C'est mieux que rien non ? 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