Daresh Posted March 10, 2016 Posted March 10, 2016 (edited) As we all know, the default category export in Prestashop is far from useful, as it exports only the current visible category table, not the whole tree. This module allows you to export all categories to a CSV file. gmexport.zip (for PS 1.6, first release so please test and give feedback) Edited January 1, 2020 by Daresh (see edit history) 9 4 1 Share this post Link to post Share on other sites More sharing options...
2BC Posted March 11, 2016 Posted March 11, 2016 Works very good with 1.6.1.4. Thank you. 1 Share this post Link to post Share on other sites More sharing options...
Perla2018 Posted March 11, 2016 Posted March 11, 2016 very good with 1.6.1.4. Thank you 1 Share this post Link to post Share on other sites More sharing options...
Lone Star Posted March 25, 2016 Posted March 25, 2016 Hi! Thanks a lot for this module, but it does not work for me. When trying to import the categories/subcategories into an empty Prestashop installation I get this error. "The category ID cannot be the same as the Root category ID or the Home category ID." Anybody knows what the issue might be here? Regards! Share this post Link to post Share on other sites More sharing options...
Daresh Posted March 25, 2016 Posted March 25, 2016 The module exports all your categories, so the Home category will also get exported, just delete this one row from the file and it should work. 1 Share this post Link to post Share on other sites More sharing options...
Lone Star Posted March 25, 2016 Posted March 25, 2016 Hi Daresh! Thanks for your quick reply. Unfortunately when deleting the first line this error message comes up instead when trying to import the file: [PrestaShopException]Parent category does not existat line 397 in file classes/Category.php 392. return 0;393. }394.395. $parent_category = new Category((int)$this->id_parent);396. if (!Validate::isLoadedObject($parent_category)) {397. throw new PrestaShopException('Parent category does not exist');398. }399. return $parent_category->level_depth + 1;400. }401.402. /** Any ideas of what the issue might be now? Regards! Share this post Link to post Share on other sites More sharing options...
Daresh Posted March 25, 2016 Posted March 25, 2016 It tells you exactly what is wrong: Parent category does not exist Share this post Link to post Share on other sites More sharing options...
garciasanchezdani Posted June 30, 2016 Posted June 30, 2016 Awesome module! It worked fine. Thanks @Daresh 1 Share this post Link to post Share on other sites More sharing options...
stefanom62 Posted September 15, 2016 Posted September 15, 2016 It worked like a charm, thank you! 1 Share this post Link to post Share on other sites More sharing options...
Daresh Posted October 26, 2016 Posted October 26, 2016 Can export product info of the selected categories ? What product info would you like to have exported? Share this post Link to post Share on other sites More sharing options...
Lausli Posted November 9, 2016 Posted November 9, 2016 From here https://www.prestashop.com/forums/topic/566670-how-i-can-export-all-categories-and-import-them-vrom-1619-to-1619/ Thak you, it works but i cant import it. Becaus i get 69 Errors like this: 69 Fehler Die ID der Kategorie kann nicht die gleiche sein wie die ID der Root-Kategorie, bzw. die ID der Home-Kategorie. Kleidung & Accessoires (ID: 15) kann nicht gespeichert werden Damenmode (ID: 16) kann nicht gespeichert werden Leggings (ID: 65) kann nicht gespeichert werden Dessous/Unterwäsche (ID: 17) kann nicht gespeichert werden Slips,Strings & Pants (ID: 79) kann nicht gespeichert werden [...] I installed a freash new prestashop Installation but i cant import the export. Di you have a solution ? Share this post Link to post Share on other sites More sharing options...
Daresh Posted November 9, 2016 Posted November 9, 2016 Maybe the home category has a different ID. You need to take a look at the exported file and check if parent ID is OK everywhere. Share this post Link to post Share on other sites More sharing options...
Lausli Posted November 9, 2016 Posted November 9, 2016 (edited) ah, i have to skip the first two lines. Now it works! Great Work! Edited November 9, 2016 by Lausli (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
pause4paws Posted November 13, 2016 Posted November 13, 2016 (edited) Greetings, Daresh, Can I have html head tags in category descriptions in categories.csv? I want to add head tags, bold, italics, etc. Does this need a new forum question? Thanks! Edited November 13, 2016 by pause4paws (see edit history) Share this post Link to post Share on other sites More sharing options...
Daresh Posted November 13, 2016 Posted November 13, 2016 Maybe it needs, cause I don't quite understand what do you need. Share this post Link to post Share on other sites More sharing options...
pause4paws Posted November 13, 2016 Posted November 13, 2016 (edited) In my csv for categories, in the description field, I want to add H1, H2, etc tags. This was a question about importing and I was told by TemplateMonster to just add the html to the description, so I did and it works. When I reach the point where I need to export the categories, I'll try your solution, Daresh. Thank you. Edited November 26, 2016 by pause4paws (see edit history) Share this post Link to post Share on other sites More sharing options...
phll Posted November 26, 2016 Posted November 26, 2016 Works perfectly!(would love the same easy way to import the same file! Thank you!PrestaShop version: 1.6.1.7 PHP version: 7.0.13 shop with SSL 1 Share this post Link to post Share on other sites More sharing options...
jsteele Posted November 29, 2016 Posted November 29, 2016 would love a way to link the images. Share this post Link to post Share on other sites More sharing options...
tarek.fellah Posted January 12, 2017 Posted January 12, 2017 Thanks for the module, but following the prestashop categories import file, there's some informations missing like meta description, meta title, meta keyword, url rewrite, category image, root category (0/1) Share this post Link to post Share on other sites More sharing options...
bynovita Posted January 12, 2017 Posted January 12, 2017 1.7.0.4 update Share this post Link to post Share on other sites More sharing options...
JensT Posted January 27, 2017 Posted January 27, 2017 Tried it on PS version 1.6.1.4: blank page after upload. Share this post Link to post Share on other sites More sharing options...
szilaszlo Posted February 23, 2017 Posted February 23, 2017 Tried it on PS version 1.6.1.4: blank page after upload. I uploaded it and just nothing showed up in the modules list, the search didn't found. V 1.6.1.4. Thanks for any help! Share this post Link to post Share on other sites More sharing options...
Daresh Posted February 23, 2017 Posted February 23, 2017 This module is so extremely simple that I can't think of anything that can cause a blank page there. Any error when turning on the debug mode? Share this post Link to post Share on other sites More sharing options...
JensT Posted February 23, 2017 Posted February 23, 2017 After upload, there is no module in my list. Disabled/enabled modules, doesn't matter where I search, there is no module GM export. Share this post Link to post Share on other sites More sharing options...
Daresh Posted February 23, 2017 Posted February 23, 2017 And no message with debug turned on? I know that the module is not yet installed, but it's the only thinkg that comes to my mind to debug this. Share this post Link to post Share on other sites More sharing options...
JensT Posted February 23, 2017 Posted February 23, 2017 Hi Daresh, probably has something to do with the write permissions, my bad. I check, install the module and I will let you know! Share this post Link to post Share on other sites More sharing options...
[email protected] Posted February 28, 2017 Posted February 28, 2017 (edited) This is adjusted version of this script that will display on the screen the category tree with IDs. It will display as table with format: <ID> Category <ID> -SubCategory <ID> --SubSubCategory etc. <?php require_once('../config/config.inc.php'); $ids = array(); //idLang is set to 1 directly in the script //idShop is set to 1 directly in the script $iso = Language::getIsoById($idLang); $row = array('id', 'name', 'parent', 'description'); generateCategoryCsvList(); echo '<table>'; foreach ($csvRow as $row){ if ($row["id"] != 2){ echo '<tr>'; echo '<td>'.$row["id"].'</td>'; echo '<td>'.$row["name"].'</td>'; echo '</tr>'; } } echo '</table>'; function generateCategoryCsvList($parent = 0) { global $ids; global $csvRow; $idLang = 1; $idShop = 1; if ($parent == 0) { $results = Db::getInstance()->ExecuteS("SELECT c.id_parent, c.id_category, CONCAT ( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(level_depth,1,''),2,''),3,'-'),4,'--'),5,'---'),6,'----'),cl.name) as name, cl.description, cl.link_rewrite,cs.position ,level_depth FROM "._DB_PREFIX_."category c LEFT JOIN "._DB_PREFIX_."category_lang cl ON (c.id_category = cl.id_category AND id_lang = 1) LEFT JOIN "._DB_PREFIX_."category_group cg ON (cg.`id_category` = c.id_category) LEFT JOIN `"._DB_PREFIX_."category_shop` cs ON (c.`id_category` = cs.`id_category` ) WHERE c.id_category <> '1' AND cs.id_shop = 1 GROUP BY c.id_category ORDER BY c.`id_parent` ASC, level_depth ASC"); foreach ($results as $row) { if (!in_array($row['id_category'], $ids)) { $csvRow[] = ['id' => $row['id_category'], 'name' => $row['name']]; array_push($ids, $row['id_category']); generateCategoryCsvList($row['id_category']); } } } else { $results = Db::getInstance()->ExecuteS("SELECT c.id_parent, c.id_category, CONCAT ( REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(level_depth,1,''),2,''),3,'-'),4,'--'),5,'---'),6,'----'),cl.name) as name, cl.description, cl.link_rewrite,cs.position ,level_depth FROM "._DB_PREFIX_."category c LEFT JOIN "._DB_PREFIX_."category_lang cl ON (c.id_category = cl.id_category AND id_lang = 1) LEFT JOIN "._DB_PREFIX_."category_group cg ON (cg.`id_category` = c.id_category) LEFT JOIN `"._DB_PREFIX_."category_shop` cs ON (c.`id_category` = cs.`id_category` ) WHERE c.id_category <> '1' AND c.id_parent = '".$parent."' AND cs.id_shop = 1 GROUP BY c.id_category ORDER BY cs.position ASC, c.`id_parent` ASC, level_depth ASC"); if (!empty($results) > 0) { foreach ($results as $row) { if (!in_array($row['id_category'], $ids)) { $csvRow[] = ['id' => $row['id_category'], 'name' => $row['name']]; array_push($ids, $row['id_category']); generateCategoryCsvList($row['id_category']); } } } } } Edited February 28, 2017 by [email protected] (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
iqbal2403 Posted March 8, 2017 Posted March 8, 2017 Works perfect.. thank you! Share this post Link to post Share on other sites More sharing options...
bibi c Posted March 16, 2017 Posted March 16, 2017 Hi Do you have a simple module to import products. i just cant get my CVS to workl Share this post Link to post Share on other sites More sharing options...
FCWC Posted September 7, 2017 Posted September 7, 2017 bibi - assume v 1.7+ with built in import.Make sure CTV is UTF 8 (which is NOT default on either Open Office or MS Office) and also use ; as delimiter. I tried , and tab etc but it failed for unknown reasons.On regards to this module - just tried on 1.7.2.2 with the above config.php and it installs. Goes to Configure BUT returns blank page when you attempt to use.A bit astonished that EXPORT isn't part of the default.Didnt use to be? Will just use SQL to export for now. Share this post Link to post Share on other sites More sharing options...
Ameenullah Posted September 29, 2017 Posted September 29, 2017 Also is there any solution to copy the sub categories also? especially for prestashop 1.7.2.2 Share this post Link to post Share on other sites More sharing options...
Michel_1911 Posted November 7, 2017 Posted November 7, 2017 Is there also a solution already for version 1.7.2.4 Share this post Link to post Share on other sites More sharing options...
spc Posted December 2, 2017 Posted December 2, 2017 Hello, is they a way of modify this to work with orders with specifik order status. Share this post Link to post Share on other sites More sharing options...
Taco Posted February 7, 2018 Posted February 7, 2018 1.7.2 funziona senza alcun problema! Grazie Share this post Link to post Share on other sites More sharing options...
Tobiasz Posted April 12, 2018 Posted April 12, 2018 Still works like a charm in 1.6.1.18. Thank you. Share this post Link to post Share on other sites More sharing options...
onl9m8 Posted May 26, 2018 Posted May 26, 2018 ps 1.7.3.1 it works without any problem! Thank you Share this post Link to post Share on other sites More sharing options...
gerryg Posted July 30, 2018 Posted July 30, 2018 Hi Daresh, I have ps 1.7.3.1. I installed the module on my localhost and on the server; worked perfect on my localhost, however is giving me an error on the server . . . any ideas how to solve this issue? Thank you, Gerry Share this post Link to post Share on other sites More sharing options...
loboslm Posted September 6, 2018 Posted September 6, 2018 Will it work for 1.4 versions? Share this post Link to post Share on other sites More sharing options...
Michel_1911 Posted December 30, 2018 Posted December 30, 2018 I was able to export all categories and subcategories using the SQL manager in prestashop. (version 1.6). The code I used is: SELECT a.`id_category`, `active`, `name`, `link_rewrite`, a.`id_parent`, a.`is_root_category`, `description`, `meta_title`, `meta_description`, a.`id_shop_default` FROM `ps_category` a LEFT JOIN `ps_category_lang` b ON (b.`id_category` = a.`id_category`) LEFT JOIN `ps_category_shop` sa ON (a.`id_category` = sa.`id_category`) WHERE 1 ORDER BY a.`id_category` ASC 1 Share this post Link to post Share on other sites More sharing options...
Belena Posted February 26, 2019 Posted February 26, 2019 (edited) This module runs on 1.7.5.1 Edited February 26, 2019 by Belena (see edit history) Share this post Link to post Share on other sites More sharing options...
airiscreative Posted April 12, 2019 Posted April 12, 2019 To EXPORT Categories in the ORIGINAL format like the sample file given by Prestashop, and ready to IMPORT at the moment the ONLY SOLUTION I found is: Go tho the PHPmyAdmin of your database and make this query: select cl.id_category as "ID", c.active as "Active (0/1)", cl.name as "Name", cl2.name as "Parent Category", c.is_root_category as "Root category (0/1)", cl.description as "Description", cl.meta_title as "Meta title", cl.meta_keywords as "Meta keywords", cl.meta_description as "Meta description", cl.link_rewrite as "URL rewritten", concat('http://', ifnull(conf.value,'example.com'), '/img/c/', c.id_category, '.jpg') as "Image URL" from ps_category c inner join ps_category_lang cl on cl.id_category = c.id_category inner join ps_category_lang cl2 on cl2.id_category = c.id_parent and cl2.id_lang = cl.id_lang left join ps_configuration conf on conf.name = 'PS_SHOP_DOMAIN' WHERE 1 AND cl.id_lang = 1 order by cl.id_lang, c.level_depth (the language you want to export is defined at penultimate line as a number, usually 1 is your primary language) Enjoy! Share this post Link to post Share on other sites More sharing options...
cafe21 Posted May 1, 2019 Posted May 1, 2019 That is great thank you My sql knowledge is very limited and I need lower levels, the subs below a specific category e.g. root> home> cat id 3 list multiple Can you help with that please? Share this post Link to post Share on other sites More sharing options...
madpugger Posted January 1, 2020 Posted January 1, 2020 On 4/12/2019 at 12:06 PM, airiscreative said: To EXPORT Categories in the ORIGINAL format like the sample file given by Prestashop, and ready to IMPORT at the moment the ONLY SOLUTION I found is: Go tho the PHPmyAdmin of your database and make this query: select cl.id_category as "ID", c.active as "Active (0/1)", cl.name as "Name", cl2.name as "Parent Category", c.is_root_category as "Root category (0/1)", cl.description as "Description", cl.meta_title as "Meta title", cl.meta_keywords as "Meta keywords", cl.meta_description as "Meta description", cl.link_rewrite as "URL rewritten", concat('http://', ifnull(conf.value,'example.com'), '/img/c/', c.id_category, '.jpg') as "Image URL" from ps_category c inner join ps_category_lang cl on cl.id_category = c.id_category inner join ps_category_lang cl2 on cl2.id_category = c.id_parent and cl2.id_lang = cl.id_lang left join ps_configuration conf on conf.name = 'PS_SHOP_DOMAIN' WHERE 1 AND cl.id_lang = 1 order by cl.id_lang, c.level_depth (the language you want to export is defined at penultimate line as a number, usually 1 is your primary language) Enjoy! Thanks for this! The only thing is, it doesn't export the description or Meta data from category_lang? How do we do this? Thanks Share this post Link to post Share on other sites More sharing options...
Daresh Posted January 1, 2020 Posted January 1, 2020 I just updated the main post with a module that should export these fields. 1 Share this post Link to post Share on other sites More sharing options...
madpugger Posted January 3, 2020 Posted January 3, 2020 Can someone tell me how to amend this query to export products as per the Prestashop Import sheet? (also maybe combos)! TIA Share this post Link to post Share on other sites More sharing options...
luzdubos Posted February 19, 2020 Posted February 19, 2020 (edited) module installed on prestashop 1.7.6.3 works great Edited February 19, 2020 by luzdubos (see edit history) Share this post Link to post Share on other sites More sharing options...
Toni-mcp Posted July 16, 2020 Posted July 16, 2020 On 10/3/2016 at 21:10, Daresh said: Como todos sabemos, la exportación de categoría predeterminada en Prestashop está lejos de ser útil, ya que exporta solo la tabla de categoría visible actual, no todo el árbol. Este módulo le permite exportar todas las categorías a un archivo CSV. gmexport.zip 28.73 kB · 279 descargas (para PS 1.6, primer lanzamiento, así que por favor pruebe y envíe sus comentarios) hola gracias por la info, pero en mi caso utilizo prestashop 1.7.6.3 y la exportación no me funciona, que puedo hacer? muchas gracias!! Share this post Link to post Share on other sites More sharing options...
Saky0333 Posted February 12, 2021 Posted February 12, 2021 Gracias por el modulo, me has salvado, en prestashop 1.7.7.0 funciona correctamente Thanks for the module, you save me, in prestashop 1.7.7.0 works correctly Share this post Link to post Share on other sites More sharing options...
Prmundo44 Posted February 15, 2021 Posted February 15, 2021 On 2/12/2021 at 9:47 PM, Saky0333 said: Gracias por el módulo. salvando que no saca bien los acentos... En la versión 1.7.7.1 funciona correcto y me saca el árbol que es lo que necesito. Share this post Link to post Share on other sites More sharing options...
Sebastvd Posted April 5, 2021 Posted April 5, 2021 Thanks for the module, in prestashop 1.7.7.3 it's works correctly. Do you have something the same for the products. I can export it with the standard prestashop but is will not let me see the combinations Share this post Link to post Share on other sites More sharing options...
Gomlers Posted November 18, 2021 Posted November 18, 2021 5 years later, it still works beatifully. Superb quality as always Thank you Dariusz! Share this post Link to post Share on other sites More sharing options...
Lausli Posted November 19, 2021 Posted November 19, 2021 Sounds good ☺️ Share this post Link to post Share on other sites More sharing options...
prestashop_user_x Posted January 10 Posted January 10 @Daresh thanks a lot for the module, it worked flawlessly in latest PrestaShop (1.7.8.2). 1 Share this post Link to post 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