PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

Module to Export Orders

87 replies to this topic
#1
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts
Hello

I am new to PrestaShop, it is the best open source shopping cart I have seen. Comes with many of the features you need.
I was looking for a module to export orders in csv format. I could not find one here, so I made a simple module myself.

There were a few other people looking for something like this. I have attached the module. Just extract it and put it in your modules folder. And set the folder write permissions.

After you install it you can generate a csv file in the configure page.

Updates:
Now the page automatically redirects to download the report.
It no longer requires write permission, and does not store the order data in a file.
Tested on 1.2.

There is also a commercial pro version available with filters. You can see it here:
http://www.bvkyazili...orders-pro.html

Attached Files



#2
Merchant

    PrestaShop Apprentice

  • Members
  • PipPip
  • 83 posts
Great works fine! thx

#3
onlinebeautydirect

    PrestaShop Newbie

  • Members
  • Pip
  • 4 posts
Hi great work, can you add more fields as notice that the product id is not included

But still excellent work.

Are you also available for other custom modules design ?


:-)

#4
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
I tried this module on V1.1 beta3 but nothing happens when "generate report" is clicked (some or all fields checked).

#5
onlinebeautydirect

    PrestaShop Newbie

  • Members
  • Pip
  • 4 posts
The report is generated in the exportorders module in the modules directory called orders.csv ;-)

#6
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
OK I found it

#7
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts

From 1228150749:

Hi great work, can you add more fields as notice that the product id is not included

But still excellent work.

Are you also available for other custom modules design ?


:-)


Thanks.

I may do some changes soon. But each order may contain multiple products, so there is not a straight way of including product id. Anyone has any good ideas?

Actually, developed this for a client, I am a full time PHP developer. You can just pm me for custom design.

#8
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts

From 1228150833:

I tried this module on V1.1 beta3 but nothing happens when "generate report" is clicked (some or all fields checked).


There is also a link below the generate report button after you first click on it. The link goes to the last generated file.

#9
jolvil

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 2706 posts
This csv includes all orders from begining of shop, is there a way to filter and have orders of a period, like a month?

#10
Paul C

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 1004 posts
I've been working on a similar one, and came across the same issue with orders containing multiple items. It's a pity that stock control programs don't use xml....

Paul
Free Prestashop modules and developer resources

Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2

Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net

#11
ruilong

    PrestaShop Addict

  • Moderators
  • 690 posts
I also started working on a similar module, but instead of saving it I tried to send it as an attachement to the header, but I kind of got strange results.. I also want to include the possibility to export customers, products and categories in the module.

the problem with orders is as pointed out that each order may have multiple products.. so it kind of depends on the import tool that is to be used how to handle this..

maybe a look at this may help? http://www.oscommerc...tributions,4728
Modules and themes for prestashop.
E-butik med prestashop inkl hosting och gratis installation.

#12
Nakano

    PrestaShop Apprentice

  • Members
  • PipPip
  • 50 posts
I installed this module successfully and it kinda works. What doesn't is the resulting CSV file.
Not sure if it's an UTF problem, but some characters come out garbled (accents and stuff like º or ª).

Also, on many cases, cell contents come out of place. I have a first part on and address in the Delivery Address field, then a 2nd half of the same address filled in Invoice address (so both Addresses are in a way wrongly displayed). Some Address parts also show up on Payment field, most everything is out of place later on and I'm not sure what went wrong.

Has anyone experienced this as well?

Also, as with many export modules, it's all nice to have an CSV export, I don't deny it, it comes in handy. But what about imports?

One limitation I find with the DB Backup under Tools is that... well... you backup everything. You're given a choice to Import different kinds of entities but you don't really have an automated way to export them, which is a shame cuz if you want to manipulate data to fix or edit some entries, you'll just end up going back to phpmyadmin and start wasting time again.

I'm not complaining, it's just an observation.


And when we import products, why does it *have* to match Product ID? If I use CSV to update info (after an export), wouldn't it make more sense to match an EAN or product reference instead? Otherwise... we'll get duplicates if we don't make sure we got the right ID.

#13
JsusSalv

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
Hello:

I installed the module on a test server and it worked fine. I then installed the module on a production server at GoDaddy and the module will not produce a download. It does produce the file but only on the server and not as a popup that I can download. So I figured I would download the file directly via FTP. However, when I open the file in Calc (alternative to Excel) it doesn't open as it should. I've tried using different encodings to see if that was the issue but to no avail. Can someone guide me on what to do? Thank you!

#14
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts
This module is not a priority for me at the moment. But I may add a date filter in the next week or so. Errors need analyzing and I can't spare the time now, I need to prioritize my clients first.

If the generated file does not open in Excel or Calc, try opening it in notepad first. There might be some characters used in product names and such that may make the file invalid.

I have also posted an update to start the file download automatically, displaying the file download popup.

#15
JsusSalv

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
That's awesome! But where is the update? I've figured out how to modify your script for other db tables. However, I'm still unclear on making it download automatically. Thank you!

#16
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts
I replaced the original file. You just need to download again.

To download automatically:
Tools::redirect('url');


#17
JsusSalv

    PrestaShop Apprentice

  • Members
  • PipPip
  • 40 posts
Great, thank you! I looked over the data on the csv and I can't figure out what would keep it from downloading when clicking on the button. It's ok, thank you for the help. The file does generate within the directory though. I'll figure out a way to download the file from there. Also, I've managed to change the tables and fields a bit for other purposes, like inventory. Would it be ok to post these other modules for the community to use? They are basically the same code as your module but with different parameters. Just wanted to make sure I'm not stepping on anyone's toes with regard to derivatives. Thanks!

#18
whitelighter

    PrestaShop Addict

  • Members
  • PipPipPip
  • 589 posts
Sure, go ahead. Would appreciate if you left the credits.

#19
jwonathan

    PrestaShop Newbie

  • Members
  • Pip
  • 17 posts
Hi,

Thanks a lot for your work.

I tried to install it with prestashop 1.1 and it doesn't seem to work: no csv file is generated at all.
I've looked into my apache error log and could not find anything except that the file doesn't exist when trying to download it.

Any idea ?


Thanks a lot

edit: it does work, needed to chmod folder :)
thks

#20
Ehinarr

    Sir

  • Members
  • PipPipPipPip
  • 1134 posts
Nice work, very usefull!!!
My Blog
PS v1.4.7.0