Jump to content
leemarkwood

[Free Module] Products Export Module V2.6.1 (Updated 05/04/2018)

Recommended Posts

Using ver 1.25. Installs OK, but getting the following error when clicking configure.

Table 'prestashop.ps_export_set' doesn't exist

SELECT * FROM `ps_export_set`


-- Graham

Share this post


Link to post
Share on other sites

Great! :-)
However, some characters get garbled, eg the Swedish å, ä, and ö; I believe this can be sorted with utf8_decode() but don't see right away where to insert it...

/Mats

Share this post


Link to post
Share on other sites

Ok, I'll have a look into your problem Graham.

Also, I hadn't thought about different character sets. I shall update asap.

  • Like 1

Share this post


Link to post
Share on other sites

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

I've added utf8_decode() to the exportproducts.php file. Just download a new copy and upload the exportproducts.php file.

Could you let me know if thats fixed the character encoding issues :)

Share this post


Link to post
Share on other sites

Hi Imwood:
Thanks for this nice module, will be posible to upload pics also?
Thanks again

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

Graham,

Thats just a notice to tell you that my coding isnt the best practice at that part in the script. I'll quickly ammend my sloppy code.

Cheers,
Lee.

Share this post


Link to post
Share on other sites

Jaap Visser,

Could you be more specific please. It's hard for me to know the exact cause. Its more than likely that the install has failed.

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

Getting further for me. No errors anymore. Can install / uninstall ok. Attached picture shows what I see. (Nothing to click?)

- Graham

16091_PbqACrs3NJI5Fu3srqCP_t

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
Jaap Visser,

Could you be more specific please. It's hard for me to know the exact cause. Its more than likely that the install has failed.


That did the job! thnx!

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

Thanks for this nice module, will be posible to upload pics also?
Thanks again


I can probably include the links to the images for each product. We will see.

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

Ok,

The module has been updated to include image urls and names instead of id's for manufacturers and categories.

Please uninstall and reinstall the module after updating all the files from the new download.

Cheers,
Lee.

Share this post


Link to post
Share on other sites

Lee you are a star!

Thanks a lot for this, this truely makes it one of the best modules here.

Share this post


Link to post
Share on other sites

Got "The following module(s) were not installed successfully:
exportproducts" when I tried to uninstall it.
Copied the files anyways and now when I use Configure I get a page without any fields to add

/Mats

Share this post


Link to post
Share on other sites

I went in by ftp after I uninstalled the first module and then deleted it physicaly off the server and then installed fresh.

Share this post


Link to post
Share on other sites

Right, but I could not uninstall.
I tried removing everything too, and add again, but same problem

/Mats

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

That's what I expected, but there are no tables between ps_employee and ps_faq...
Anyways, I just deleted exportproducts in the modules table and it seems to be ok.
Thanks.

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

Hi,
I'm so monvidedressing, with a shop all is ok, but with an another shop, the button "save set" does not work and my file csv is empty...

problem with a CHMOD???? help (i have 777)

I'm french to
Thanks

Share this post


Link to post
Share on other sites

lmwood yes i'have reinstalled but nothing in the csv
strange because on a another site it works well

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 you are correct, I didn't update the title column. I'll do that now ;)

As for the meta description, etc. I'll have a look.

Share this post


Link to post
Share on other sites

ok lmwood thanks ...
For the price problem for the french, for convert sql, perhaps preg_replace("#,#", '.', 'price') but where?

Share this post


Link to post
Share on other sites

Updated.

Price should now be displayed as it would on a shop page using the default currency. I'll add an option to turn this feature off as I'm sure not everyone will want it.

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

Well, I did have plans to make the export and import module. So im sure I can accommodate more than the standard import allows.

e.g. updating products, category names, etc.

We will see.

Share this post


Link to post
Share on other sites

I would like to say thank you for this wonderfull contribution and diligently improving it for the benefit of the community.

Share this post


Link to post
Share on other sites

One small thing: If I chose a field and then change my mind and klick clear, the field don't go back to available fields.

/Mats

Share this post


Link to post
Share on other sites
If I chose a field and then change my mind and klick clear, the field don’t go back to available fields.


I don't have this problem with last update, "clear" works fine for me., fields come back.

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

Great Modules Thanks a Bunch
Everything worked fine.

But having some trouble importing into a new site.

How do i get this thing to import my exported csv into a new site?

Thanks

Share this post


Link to post
Share on other sites

@chti59

I have plans to include an attribute export as part of this module but it is currently not possible to export them.

@hackia

The module is export only at the moment. You will have to use the standard prestashop import.

Share this post


Link to post
Share on other sites

Can I use the exporeted file from this module,
to import with prestashop standard import,

if so please someone step by step,
thousands of other would appreciate it,
i tried again and again and get all types of errors on the import.

Thanks in advance.

Share this post


Link to post
Share on other sites

Hey Imwood,

Thanks for this great module! It really gets our life way easier ;)
I was wondering about a few things... sorry if I missed them reading at this topic.
What about declinaisons ? No way to add them in the file aswell ?
And what about other translations of a product... would there be a way to dump them all at once so they can be readded at one too through existing prestashop import tool or though your upcoming import script ;)

Just a stupid question, if I export let's say french version, then english version, when I do the import, wouldn't be the english version wiping the french one if I would import it in second ?

Having declinaisons included in the export would so make our life much more easier :)

*Crossing fingers here!*

Keep on the great work!

-k-

Share this post


Link to post
Share on other sites
Hello all,

I've created an easy to use product export module which is free to download and use.

Export Products v0.2

Features
* Choose what to export by dragging and dropping from available fields.
* Choose how you want the export ordered by easily sorting the selected fields.
* Save an export so you can load your chosen fields again later.
* Clean easy to use interface.
* Language Select.
* Delimiter option.


Download: Export Products v0.2

Please remember this is the modules first release and is has not be tested in all browsers. It should work for most versions of prestashop if not all. Also backup your database before doing any export/imports.


Is this supposed to work on 1.1? I cannot get the module to install. Thanks...

Share this post


Link to post
Share on other sites

I've not tested with 1.1. So I take it from your comments that it does not function with 1.1 I'll install 1.1 at some point and see if I can solve the problem for you.

Share this post


Link to post
Share on other sites

Hi lmwood...
Just a little question...
In cvs, in Format Currency, if i want 99,00 € instead of 99,00 EUR, how can i do?
Thanks

Share this post


Link to post
Share on other sites

thanks lmwood, but i changed here:
(see picture)

But i have in csv EUR not €
Or how to have 9,99 without the symbol €

Thanks

17062_2NyFpzeAs6pm6JzkPxZI_t

Share this post


Link to post
Share on other sites

Well in all fairness I shouldnt have even included that feature as it really isnt needed. It's very simple just to format the cells in your chosen spreadsheet program if you required the currency changing.

I may chose to remove the currency conversion all together since like I say its not required.

Share this post


Link to post
Share on other sites

ok lmwood I understand that you do not include this possibility, but can you say me how to remove the EUR (9,99 only)
thank you again for your sympathy

Share this post


Link to post
Share on other sites

Just untick the box on the export for format currency and it should just give you plain pricing without symbols.

Share this post


Link to post
Share on other sites

Thanks lmwood, it's ok pricing without symbol but i have a point not a coma as separator.
i'm looking for, thank you again for your patience

Share this post


Link to post
Share on other sites

Maxhome,

Find and replace on that column ? in your spreadsheet editor ? Surely that should do it quickly enough.

Share this post


Link to post
Share on other sites

Maxhome,

you can change that when you import the file in excel. Just use "data -> from text" and then you can choose the preferences, in step 3 click advanced and choose decimal separator there.

Share this post


Link to post
Share on other sites