PrestaShop Forums: Module to Export Orders - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Module to Export Orders


Module to Export Orders

#1 whitelighter

    PrestaShop Addict

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 01 December 2008 - 02:53 PM

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 File(s)



#2 Merchant

    PrestaShop Apprentice

  • 24 Aug 2008
  • Members
  • PipPip
  • 83 posts

Posted 01 December 2008 - 05:22 PM

Great works fine! thx

#3 onlinebeautydirect

    PrestaShop Newbie

  • 01 Dec 2008
  • Members
  • Pip
  • 4 posts

Posted 01 December 2008 - 05:59 PM

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

  • 22 Dec 2007
  • Members
  • PipPipPipPip
  • 2672 posts
  • Location:Paris

Posted 01 December 2008 - 06:00 PM

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

  • 01 Dec 2008
  • Members
  • Pip
  • 4 posts

Posted 01 December 2008 - 06:53 PM

The report is generated in the exportorders module in the modules directory called orders.csv ;-)

#6 jolvil

    PrestaShop Fanatic

  • 22 Dec 2007
  • Members
  • PipPipPipPip
  • 2672 posts
  • Location:Paris

Posted 01 December 2008 - 10:07 PM

OK I found it

#7 whitelighter

    PrestaShop Addict

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 02 December 2008 - 02:43 AM

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

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 02 December 2008 - 02:44 AM

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

  • 22 Dec 2007
  • Members
  • PipPipPipPip
  • 2672 posts
  • Location:Paris

Posted 02 December 2008 - 09:23 AM

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

  • 02 Aug 2008
  • Members
  • PipPipPipPip
  • 1003 posts
  • Location:Dundee, Scotland, United Kingdom

Posted 02 December 2008 - 10:06 AM

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

  • 26 Jul 2008
  • Moderators
  • 672 posts
  • Location:Beijing, China

Posted 03 December 2008 - 05:12 PM

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

  • 14 Aug 2008
  • Members
  • PipPip
  • 50 posts

Posted 05 December 2008 - 06:56 AM

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

  • 15 May 2008
  • Members
  • PipPip
  • 40 posts

Posted 07 December 2008 - 01:20 PM

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

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 07 December 2008 - 02:26 PM

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

  • 15 May 2008
  • Members
  • PipPip
  • 40 posts

Posted 07 December 2008 - 03:44 PM

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

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 07 December 2008 - 03:47 PM

I replaced the original file. You just need to download again.

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


#17 JsusSalv

    PrestaShop Apprentice

  • 15 May 2008
  • Members
  • PipPip
  • 40 posts

Posted 07 December 2008 - 04:34 PM

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

  • 01 Dec 2008
  • Members
  • PipPipPip
  • 550 posts

Posted 07 December 2008 - 04:58 PM

Sure, go ahead. Would appreciate if you left the credits.

#19 jwonathan

    PrestaShop Newbie

  • 16 Dec 2008
  • Members
  • Pip
  • 17 posts

Posted 09 February 2009 - 05:21 PM

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

  • 01 Nov 2008
  • Members
  • PipPipPipPip
  • 1120 posts

Posted 11 February 2009 - 10:50 PM

Nice work, very usefull!!!
My Blog
PS v1.4.6.1





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users