Jokeriders Posted December 10, 2015 Share Posted December 10, 2015 Bonjour, je suis accessoiriste moto J'ai créé environ 4000 catégories sous forme : CAT>SousCAT>Sous-sousCAT>Sous-sous-sousCAT en gros : MARQUE > CYLINDREE > MODELE > ANNEE afin que mon client puisse utilisé la recherche en cascade. mon problème est l'association des produits génériques qui peuvent allés dans toutes les catégories. la solution de base étant d'aller dans chaque fiche produit > association > choisir les categories Bon comme moi si on a des centaines de produits a associer dans 4000 categories a chaque fois ... je suis bon pour me faire explosé le creveau, les yeux, l'index et ma souris !!! quelqu'un aurait un module a conseiller ou une astuce ? merci Link to comment Share on other sites More sharing options...
Eolia Posted December 10, 2015 Share Posted December 10, 2015 une requête sql qui associe id_produit/id_category dans la table ps_category Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 Pourrait tu me donner un modele de ligne de commande sql pour que je puisse l'adapter a mon besoin . Associé plusieurs catégories a un produit ? merci Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 ex : id produit 950 a associer dans les id catégories 480 à 485 Link to comment Share on other sites More sharing options...
Eolia Posted December 10, 2015 Share Posted December 10, 2015 INSERT INTO `ps_category_product`(`id_category`, `id_product`) VALUES (480, 950), (481, 950), (482, 950), (483, 950), (484, 950), (485, 950); Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 erreur : SELECT n'existe pas. Link to comment Share on other sites More sharing options...
Eolia Posted December 10, 2015 Share Posted December 10, 2015 euh... Vous ne pouvez pas faire de requête type INSERT, UPDATE, DELETE depuis l'interface Prestashop, hein ! Ouvrez phpmyadmin sur votre hébergement et tout ira beaucoup mieux^^ Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 lol ! bon bah c'est la merde ... j'ai pas précisé que j’étais sur le Cloud ... Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 merci en tous cas , encore une fois qui me donne envie de migrer vers le download Link to comment Share on other sites More sharing options...
Eolia Posted December 10, 2015 Share Posted December 10, 2015 Bienvenue chez nous Link to comment Share on other sites More sharing options...
Baba deCode Posted December 10, 2015 Share Posted December 10, 2015 (edited) Salut, Tu peux faire ca en csv, via l'outils d'import sachant que le premier numero sera associé comme categorie par defaut. donc en 1 tu exportes tout tes produits avec ce genre de requete dans le gestionnaire SQL: SELECT p.`id_product` AS `ID`, b.name as `Nom`,`reference`, cl.`id_category` AS `ID Cat defaut`, cl.`name` AS `Cat defaut`, GROUP_CONCAT(DISTINCT(c.id_category) SEPARATOR ",") as categories, GROUP_CONCAT(DISTINCT(case when length(im.`id_image`)=6 then concat('http://tonsite.com/img/p/',insert(insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),10,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=5 then concat('http://tonsite.com/img/p/',insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=4 then concat('http://tonsite.com/img/p/',insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=3 then concat('http://tonsite.com/img/p/',insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=2 then concat('http://tonsite.com/img/p/',insert(im.`id_image`,2,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=1 then concat('http://tonsite.com/img/p/',insert(im.`id_image`,2,0,'/'),im.`id_image`,'.jpg') else '' end) SEPARATOR ",") as "Images", sa.`price`, ml.meta_title AS 'Marque', ml.id_manufacturer AS 'Marque ID', p.price as price, sa.active as active, p.ean13 AS 'EAN13', p.upc AS 'UPC', sav.`quantity` AS `quantite`, p.visibility, p.indexed, pl.description_short, pl.description, pl.meta_title, pl.meta_keywords, pl.meta_description, MAX(image_shop.id_image) id_image, concat(pl.`link_rewrite`,'-',p.`id_product`,'.html') as "ProductURL google", concat('http://tonsite.com/',pl.`link_rewrite`,'-',p.`id_product`,'.html') as "Produit URL", case when length(im.`id_image`)=6 then concat('http://tonsite.com/img/p/',insert(insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),10,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=5 then concat('http://tonsite.com/img/p/',insert(insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),8,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=4 then concat('http://tonsite.com/img/p/',insert(insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),6,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=3 then concat('http://tonsite.com/img/p/',insert(insert(im.`id_image`,2,0,'/'),4,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=2 then concat('http://tonsite.com/img/p/',insert(im.`id_image`,2,0,'/'),'/',im.`id_image`,'.jpg') when length(im.`id_image`)=1 then concat('http://tonsite.com/img/p/',insert(im.`id_image`,2,0,'/'),im.`id_image`,'.jpg') else '' end as "ImgURL_1" FROM `ps_product` p LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product) LEFT JOIN ps_category_product cp ON (p.id_product = cp.id_product) LEFT JOIN ps_category_lang cl ON (cp.id_category = cl.id_category) LEFT JOIN ps_category c ON (cp.id_category = c.id_category) LEFT JOIN `ps_product_lang` b ON (b.`id_product` = p.`id_product` AND b.`id_lang` = 1 AND b.`id_shop` = p.id_shop_default) LEFT JOIN `ps_image` i ON (i.`id_product` = p.`id_product`) LEFT JOIN `ps_manufacturer_lang` ml ON (p.id_manufacturer = ml.id_manufacturer) LEFT JOIN `ps_stock_available` sav ON (sav.`id_product` = p.`id_product` AND sav.`id_product_attribute` = 0 AND sav.id_shop_group = 0 AND sav.id_shop = 1 ) JOIN `ps_product_shop` sa ON (p.`id_product` = sa.`id_product` AND sa.id_shop = p.id_shop_default) LEFT JOIN `ps_shop` shop ON (shop.id_shop = p.id_shop_default) LEFT JOIN `ps_image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop = p.id_shop_default) LEFT JOIN `ps_product_download` pd ON (pd.`id_product` = p.`id_product`) LEFT JOIN `ps_image` im on im.`id_product`= p.`id_product` WHERE 1 AND pl.id_lang = 1 GROUP BY sa.id_product ORDER BY p.`id_product` ASC En 2 tu te crée un csv avec une colonne ID une colonne nom et la colonne des categories et tu t'amuse a mettre les numeros des cat... En 3 tu importes en faisant matcher avec le champ Catégorie (x,y,z...) Edited December 10, 2015 by Alexandre-KM (see edit history) Link to comment Share on other sites More sharing options...
Oron Posted December 10, 2015 Share Posted December 10, 2015 Bonjour Avant de poster rechercher le bon forum, je sais que le forum a changer mais il reste quand une organisation logique. Topic déplacé dans le forum Aide et support communautaire - Utilisation de Prestashop configuration et difficultés. Link to comment Share on other sites More sharing options...
Jokeriders Posted December 10, 2015 Author Share Posted December 10, 2015 désolé , c'est vrai je sais pas ce que j'ai foutu :/ Alex : j'ai voulu le faire comme ca , créer un CSV avec uniquement les cases ID produit et ID CATs rempli , pensant que ca allait écrasé seulement les asso cats , mais ca plante il me manque le nom du produit , et meme si je le mets pas sur qu'il plante pas pour encore chose ou meme qu'il me supprime le descriptif par ex ... ca va demander un max de taff cette histoire :/ Link to comment Share on other sites More sharing options...
Baba deCode Posted December 11, 2015 Share Posted December 11, 2015 Il faut que tu fasses une colonne ID une colonne NOM et une colonne ID Cat. Dans les options du debut j ai oublié de te le dire, tu coches uniquement "utiliser l'id comme clef", ca va te mettre a jour la bdd... Sinon tu va dans phpmyadmin et tu fait comme l'indique Eolia Link to comment Share on other sites More sharing options...
Eolia Posted December 11, 2015 Share Posted December 11, 2015 Sinon tu va dans phpmyadmin et tu fait comme l'indique Eolia Pas de phpmyadmin sur le cloud... il faut installer un adminer depuis le ftp du coup^^ Link to comment Share on other sites More sharing options...
Baba deCode Posted December 11, 2015 Share Posted December 11, 2015 Ah c'est ptetre pour ca que ca plante alors si c'est sur le cloud, le serveur doit avoir une config basique de serveur mutu Link to comment Share on other sites More sharing options...
Jokeriders Posted December 11, 2015 Author Share Posted December 11, 2015 punaise je suit plus la .... est ce que mon idée de vouloir ecraser les associations avec un CSV est possible ? si oui je veux bien essayé ca d'abord , c'est quelque chose de j'arrive a "maitrisé" mais apres c'est trop compliqué pour moi les requetes sql et tout !! :/ 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