Jump to content

[Free Module] Products Export Module V2.7.1 (Updated 23/07/2020)


leemarkwood
 Share

Recommended Posts

Graham,

I'd left out the set table's sql from the install sql file.

CREATE TABLE IF NOT EXISTS `ps_export_set` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `set_name` varchar(200) NOT NULL,
 `set_values` text NOT NULL,
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;



Running the above sql in phpMyAdmin should do the trick. If you dont have access to phpMyAdmin pm me and i'll help you out.

Share this post


Link to post
Share on other sites

Still having some issues. Getting to the configure page now but seeing:

Notice: Undefined index: export_data in D:\localhost\www\bestbooksforkids\modules\exportproducts\exportproducts.php on line 83

Should clarify that I am running a test site (locally using Wampserver), and I have had issues (resolved I hoped) with my database due to hung Prestashop upgrade in the past.

- Graham

Share this post


Link to post
Share on other sites

I've download the new version...
Install it in the back office...
Try to run the module and get this screen notice:
-----------------------------------------------------------
Table 'prestashop.ps_export_fields' doesn't exist

SELECT * FROM `ps_export_fields`
-----------------------------------------------------------

Share this post


Link to post
Share on other sites

If you have phpMyAdmin or another tool you can run an sql command in then please run the following code on your database.

CREATE TABLE IF NOT EXISTS `ps_export_fields` (
   `id` int(10) NOT NULL auto_increment,
   `field_name` varchar(50) NOT NULL,
   `database_name` varchar(50) NOT NULL,
   `category` varchar(50) NOT NULL,
   `position` int(2) NOT NULL default '0',
   PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

CREATE TABLE IF NOT EXISTS `ps_export_set` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `set_name` varchar(200) NOT NULL,
 `set_values` text NOT NULL,
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

INSERT INTO `ps_export_fields` (`id`, `field_name`, `database_name`, `category`, `position`) VALUES
(1, 'Product Id', 'id_product', 'products', 0),
(2, 'Product Reference', 'reference', 'products', 0),
(3, 'Name', 'name', 'products_lang', 0),
(4, 'Short Description', 'description_short', 'products_lang', 0),
(5, 'Long Description', 'description', 'products_lang', 0),
(6, 'Quantity', 'quantity', 'products', 0),
(7, 'Price', 'price', 'products', 0),
(8, 'Wholesale Price', 'wholesale_price', 'products', 0),
(9, 'Supplier Name', 'id_supplier', 'products', 0),
(10, 'Manufacturer', 'id_manufacturer', 'products', 0),
(11, 'Tax %', 'id_tax', 'products', 0),
(12, 'Categories', 'id_category_default', 'products', 0),
(13, 'On Sale', 'on_sale', 'products', 0),
(14, 'Reduction Price', 'reduction_price', 'products', 0),
(15, 'Reduction %', 'reduction_percent', 'products', 0),
(16, 'Reduction From', 'reduction_from', 'products', 0),
(17, 'Reduction To', 'reduction_to', 'products', 0),
(18, 'Supplier Reference', 'supplier_reference', 'products', 0),
(19, 'Weight', 'weight', 'products', 0),
(20, 'Date Added', 'date_add', 'products', 0),
(21, 'Active', 'active', 'products', 0),
(22, 'Meta Title', 'meta_title', 'products_lang', 0),
(23, 'Meta Description', 'meta_description', 'products_lang', 0),
(24, 'Meta Keywords', 'meta_keywords', 'products_lang', 0),
(25, 'Available Now', 'available_now', 'products_lang', 0),
(26, 'Available Later', 'available_later', 'products_lang', 0),
(27, 'Tags', 'tags', 'products', 0),
(28, 'Accessories', 'accessories', 'products', 0);

  • Like 1

Share this post


Link to post
Share on other sites

Hi Imwood,

I've downloaded the new version and also added the new table into my sql database but I'm still receiving the:

Table '34100m23542_3.export_set' doesn't exist

SELECT * FROM `export_set`

Error message
Best Regards
Dirk

Share this post


Link to post
Share on other sites

Kwonga,

I'm going to rewrite the install part of the script as many people are having problems with it. Hang tight.

To get up and running now, please run the sql code above once again but replace "ps_export_fields" with "export_fields" and "ps_export_set" with "export_set".

Jaap Visser,

I'll have another version up as soon as the paths are no longer relative.

Share this post


Link to post
Share on other sites

Kwonga,

I'm going to rewrite the install part of the script as many people are having problems with it. Hang tight.

To get up and running now, please run the sql code above once again but replace "ps_export_fields" with "export_fields" and "ps_export_set" with "export_set".

Jaap Visser,

I'll have another version up as soon as the paths are no longer relative.


Ok, I will wait for it :) thnx!

Share this post


Link to post
Share on other sites

Hi Imwood,

just did that:

Kwonga,

I'm going to rewrite the install part of the script as many people are having problems with it. Hang tight.

To get up and running now, please run the sql code above once again but replace "ps_export_fields" with "export_fields" and "ps_export_set" with "export_set".


and of course...as all my tables in the database don't have the "ps_" in front....
That did the Job!!!!
Many thanks!
Great Module!

Kind Regards
Dirk

Share this post


Link to post
Share on other sites

Ok, the Zip file has been updated. Please download it and then upload exportproducts.php and exportproducts.tpl

If nothing changes straight away, make sure to clear your cache by deleteing the following file (Tools/Smarty/Compile/%%XX^XXX^XXXXXXXX%%exportproducts.tpl.php)

Share this post


Link to post
Share on other sites

Got the screen I expect. Dragged some available fields to selected fields. Saved a field set (called it Test). Clicked on Export now and got:

Notice: Undefined index: id_product in D:\localhost\www\bestbooksforkids\modules\exportproducts\exportproducts.php on line 170

Notice: Undefined index: id_product in D:\localhost\www\bestbooksforkids\modules\exportproducts\exportproducts.php on line 188
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

SELECT id_tag FROM `ps_product_tag` WHERE `id_product`=

Share this post


Link to post
Share on other sites

Very good module, seem to works fine on my 1.2 PS.

I would like to tell about an idea for a kind of product export module.

It could be very usefull to be able to export products one by one, I've got some kind of products that have been sold and that I want to take of the database because i will not sold it now, but I would like to keep all informations and to be able to import it in one click later or why not with drag'n drop method. It could be stocked on individual files for each product. One product=one file with all informations for this product.

What do you think about?

Share this post


Link to post
Share on other sites

Successfully selected fields and downloaded a csv that seemed ok. One issue I found was how it handled text like:


By Pamela Allen
" 'Stay close, take care,' quacked Alexander's mother, but Alexander did not stay close and he did not take care. He straggled behind with his head in the air" - and disappeared down a deep dark hole.

I only got the By Pamela Allen bit (I assume the " ' quote combination threw the process). Can probably alter then to suit on shop end.

I've gotta sleep now (2am in Aust). Congrats on the module so far.

Share this post


Link to post
Share on other sites

Seems I have some problems:

- Each product appears four times, two times with short description and two without, the other fields are there for all four copies.

- Some items get wrong info in some fields, eg Short Description in the Product ID Field

- < p > and < / p > tags appears in the Short Description


/Mats

Share this post


Link to post
Share on other sites

Well done an excellent quality module for prestashop and its free!

The last thing that is really needed is the images, then I can adapt the csv file for a number of different things such as google base, or populating a new prestastore.

Well done again

Share this post


Link to post
Share on other sites

This is an excellant module and just what I have been looking for, now its possible to mass update products, using this module and the import feature.

One request though, is it possible to add a link to the products.csv file after its been generated. I didnt even know it had been generated until i just happened to look in the folder, maybe even being able to edit the file name and file location.

Also the ability to select which delimiter to use in the file would be useful, as I dont use comma usually.

Didnt have any problems installing or using this module either.

Share this post


Link to post
Share on other sites

Mohsart,

If you have phpmyadmin or some similar tools. Drop export_fields and export_set from your db then go into the modules table and remove the row that relates to the export module, it should be at the bottom of the table.

Once you have done the above just hit install again on the modules page.

Share this post


Link to post
Share on other sites

Mohsart,

If you have phpmyadmin or some similar tools. Drop export_fields and export_set from your db then go into the modules table and remove the row that relates to the export module, it should be at the bottom of the table.

Once you have done the above just hit install again on the modules page.

A little lost here, sorry.
What are export_fields and export_set? I don't have any tables with those names.

/Mats

Share this post


Link to post
Share on other sites

Great module really nice work. :-)

Working on localhost and on server with prestashop 1.2.5 with small corrections.
My shop is still in development and i don't have translation of my products to English.
I dont know if this is best way but i added and pl.`id_lang` = 4 to this query

            $sql='SELECT p.`id_product`, '.implode(', ', $fields).'
           FROM '._DB_PREFIX_.'product as p
           LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` and pl.`id_lang` = 4)
           GROUP BY p.`id_product`
           ';     


and i removed utf8_decode :-) because some letters wasn't displayed correctly.

Share this post


Link to post
Share on other sites

Very good, great.

But a little problem!
Working on localhost but not on my server.
The button "Save set ", "Load set" etc are inactive
When i clicked on "export now" -> blank page

Problem with relative links?

Thanks for your help

Share this post


Link to post
Share on other sites

Mohsart,

do you have all your fields with "ps_" at the start ? if so the tables to drop would be "ps_export_fields" and "ps_export_set".

I'll add support to allow the user to choose which language they wish to export with soon.

Maxhome,

Not sure what your problem is... when did you download the module? do you have the latest copy?

Share this post


Link to post
Share on other sites

Hello Imwood,

Thank you so much.......module work fine in 1.2.1, all products appears. You are so strong !!!!

URL image isn't good there is 1.1/armani-perfum.jpg instead of - and it's /img/p/

Can you put url of product, options and attributs ? I know I ask you much things but now, we ave a God in export products !!!!!!!!

Share this post


Link to post
Share on other sites

Just FYI, my previous note about weird info in the Priduct ID field is not valid, it showed up like that when I imported to MS Excel, but if I open with Open Office it shows up just fine.

Thanks for a great module! <3

/Mats

Share this post


Link to post
Share on other sites

Hi,

Thanks for your response mohsart !

With an another shop, I have a problem with description. I open products.csv with MS Excel and my description was cut and create a ligne or more to notify rest of my description.
Could we have a .csv with ; instead of , ??? Thanks !
PS I'm french, sorry for my english !

Share this post


Link to post
Share on other sites

Maxhome,

J'ai résolu le problème, et; à la ligne 232 à exportproducts.php:
Il y a
 export_final $, ','
remplacer par
 $ export_final, ';'
Seule la première ligne ne changent pas, mais avec MS Excel I portent les informations dans les colonnes de droite.

PS Maxhome: parler anglais à un ami français .... C'est tellement étrange!

Share this post


Link to post
Share on other sites

To change the first line with title
try to change ',' line 171 to
fwrite($f, implode(';', $titles)."\r\n");


I've nothing on csv export fields: Meta Title,Short Description,Long Description,Tags,Meta Keywords,Meta Description

other fields seems OK

an idea?

Share this post


Link to post
Share on other sites

thanks lmwood for this update but Meta Keywords, Meta Description, Meta Title are empty.
Delimiter is ok for the fields but no for column title (Name, Categories, Weight, Meta Keywords, Meta Description, Meta Title, Images, Quantity)

For the symbol ' (apostrophe) in the text i have changed

$export_final[$field] = utf8_decode($export[$field]);


by

$export_final[$field] = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $export[$field]);



for the French, the price is in the form 4,5 but here 4.5 How can we change this please ???

Many thanks for your good job

Sorry for my english

for the colum i have changed

fwrite($f, implode(', ', $titles)."\r\n");


by

fwrite($f, implode('; ', $titles)."\r\n");

Share this post


Link to post
Share on other sites

Yes price is displayed now like that:

Price
10,00 EUR

so it's not a good thing if you want to import csv in Prestashop, perhaps the way to export should be the same way Prestashop can import csv files.

same with categories: should it be id of categorie or name of categorie?

oher thing: it could be usefull to have a select all option.

Share this post


Link to post
Share on other sites

lmwood,

Thanks a massive bunch for this mod. Prestashop is awesome, no doubt about that, but there are unfortunately some gaps in what is otherwise a brilliant product.

Those gaps are been filled by killer mods such as yours and others.
Thanks for being willing to help make Prestashop even better. We all benefit from dedication such as yours.

Regards,

Share this post


Link to post
Share on other sites

Totally agreed with mandrin. Thanks again for great work.

Hope you don't mind if give some suggestions.
Choosing languages works great but there is small bug with Categories names,line 187 exportproducts.php

$category = new Category($cat['id_category'], 1);
i think it should be 
$category = new Category($cat['id_category'], $lang);   



Now suggestions for future versions :-)
If you could add another drop-down list for encoding/charset like in Preferences>>PDF
I changed to cp1250

$export_final[$field] = iconv("UTF-8", "cp1250", $export[$field]);


Another thing is formatting of prices,could it look like when editing Currency in Payment >> Currencies - Formatting?

EDIT: cp1250 works for exporting but leaving in utf also works for me

$export_final[$field] =  $export[$field]; 


and it is better for importing in PrestaShop :-)

Share this post


Link to post
Share on other sites

Can we import in BO to a new store Presta and then is show correctly in the new one? Is it possible this? The fields "Save a field" or "Load a Field" is for what? Sorry for my questions, but i´m new in presta, thanks a lot

Share this post


Link to post
Share on other sites

Hi all
Just such a module I was looking for ..
It was no problem to install the module

One question
But I get the following error

Not Found
The requested URL /prestashop/modules/exportproducts/products.csv was not found on this server.

Regards Arold

Share this post


Link to post
Share on other sites

I had a similar problem; it turned out that I had installed the module as "root" and the Web server did not have write access to the directory.

Check that your web server userid has write access to /prestashop/modules/exportproducts/

--

Just want to add my thanks for this excellent module

Martin

Share this post


Link to post
Share on other sites

Hi

Installed module with no problem and was able to export but (there is always a but) ;-)

But if your product have attributes how can you export it.

Each attributes has a difference reference, It is just to make a list for inventory list, and my products are sold in 1kg, 2 kg etc... and each have a difference reference.

Share this post


Link to post
Share on other sites