kaball Posted March 29, 2014 Share Posted March 29, 2014 Bonjour à tous, J'ai besoin de faire un export de produit et je m'appuie sur des requetes sql. La requete fonctionne a peu près mais ne remonte pas dans le tableau : La désignation, Le résumé La description Version Prestashop 1.5.6.0 Débutant est ce que quelqu'un peut m'aider a débugger voici la requete sql : En vous remerciant SELECT DISTINCT psp_product.reference AS 'reference', psp_product.supplier_reference AS 'reference fournisseur', psp_product_lang.name AS 'designation', psp_manufacturer.name AS 'marque', psp_product.price AS 'prix_ht', psp_product_lang.description_short AS 'resume', psp_product_lang.description AS 'Description', psp_product.quantity AS 'quantite', psp_product.active AS 'Actif (0.1)' FROM psp_product LEFT JOIN (psp_category_product, psp_product_lang, psp_manufacturer) ON ( psp_product.id_product = psp_category_product.id_product AND psp_product.id_product = psp_product_lang.id_product AND psp_product.id_product = psp_product_lang.id_product AND psp_product.id_product = psp_category_product.id_product AND psp_product.id_manufacturer = psp_manufacturer.id_manufacturer ) Link to comment Share on other sites More sharing options...
PrestUser Posted March 29, 2014 Share Posted March 29, 2014 Bonjour, Ces conditions sont en double : psp_product.id_product = psp_category_product.id_product et psp_product.id_product = psp_product_lang.id_product Voyez si cela fonctionne en les supprimant. Cordialement. Link to comment Share on other sites More sharing options...
kaball Posted March 29, 2014 Author Share Posted March 29, 2014 Bonjour Prestuser j'ai suivi vos conseils mais sans succès SELECT DISTINCT psp_product.reference AS 'reference', psp_product.supplier_reference AS 'reference fournisseur', psp_product_lang.name AS 'designation', psp_manufacturer.name AS 'marque', psp_product.price AS 'prix_ht', psp_product_lang.description_short AS 'resume', psp_product_lang.description AS 'Description', psp_product.quantity AS 'quantite', psp_product.active AS 'Actif (0.1)' FROM psp_product LEFT JOIN ( psp_category_product, psp_product_lang, psp_manufacturer ) ON ( psp_product.id_product = psp_category_product.id_product AND psp_product.id_product = psp_product_lang.id_product AND psp_product.id_manufacturer = psp_manufacturer.id_manufacturer comment faire ? Link to comment Share on other sites More sharing options...
kaball Posted March 29, 2014 Author Share Posted March 29, 2014 J'ai modifié la requête en utilisant SQL MANAGER du Boffice. Je la post car cela peut en aider d'autres Cela fonctionne mais les images produits sont absentes! quelqu'un saurait m'aider a terminer pour que cela soit operationnel ? Merci beaucoup SELECT p.id_product, p.active, pl.name, GROUP_CONCAT(DISTINCT(cl.name) SEPARATOR ",") as categories, p.price, p.id_tax_rules_group, p.wholesale_price, p.reference, p.supplier_reference, p.id_supplier, p.id_manufacturer, p.upc, p.ecotax, p.weight, p.quantity, pl.description_short, pl.description, pl.meta_title, pl.meta_keywords, pl.meta_description, pl.link_rewrite, pl.available_now, pl.available_later, p.available_for_order, p.date_add, p.show_price, p.online_only, p.condition, p.id_shop_default FROM psp_product p LEFT JOIN psp_product_lang pl ON (p.id_product = pl.id_product) LEFT JOIN psp_category_product cp ON (p.id_product = cp.id_product) LEFT JOIN psp_category_lang cl ON (cp.id_category = cl.id_category) LEFT JOIN psp_category c ON (cp.id_category = c.id_category) LEFT JOIN psp_product_tag pt ON (p.id_product = pt.id_product) WHERE pl.id_lang = 1 AND cl.id_lang = 1 AND p.id_shop_default = 1 AND c.id_shop_default = 1 GROUP BY p.id_product Link to comment Share on other sites More sharing options...
kaball Posted March 30, 2014 Author Share Posted March 30, 2014 Est ce que quelqu'un peux m'aider a débugger ma requete ? j'ai besoin d'exporter les images produits mais je ne sais pas comment faire Merci Link to comment Share on other sites More sharing options...
loulou66 Posted March 30, 2014 Share Posted March 30, 2014 Coucou en cherchant sur le net j'ai trouver ce module qui exportent en xlm http://netvianet.com/prestashop-module/39-export-xml-products-free.html il utilise la fonction getImages($id_lang, $id_product, $id_product_attribute = NULL) de la class image.php puis avec un boucle in construit l'url foreach($imgs as $im){ $sfile = _PS_BASE_URL_.__PS_BASE_URI__.'img/p/'.$this->fimgDir($im['id_image']).$this->fimgName($row['id_product'],$im['id_image']).'.jpg'; $img[]=$sfile; $imt[]=$im['legend']; } et il injecte $sfile dans le xml en t'en inspirant tu dois pour voir y arriver le module enregistrais en csv a la base avec une ancienne version il faut la demander par mail tester sous un ps 1.6 @++ Loulou66 Link to comment Share on other sites More sharing options...
kaball Posted March 31, 2014 Author Share Posted March 31, 2014 Merci à toi Loulou66, j'ai utilisé le module ancienne version de netvianet.com pour l'export csv. Cela fonctionne 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