Jump to content



Photo
- - - - -

Export orders into csv


  • Please log in to reply
103 replies to this topic

#61   gregp

gregp
  • Members
  • 61 posts
  • Real Name:Greg

Posted 30 September 2008 - 00:51

It seems not many people using this contribution because the forum support is very sparse...

I would love to know how the fields can be altered!

Specifically, I would love to add header titles. And how to move the output columns around ? I've tried working on this and it is not obvious at all.... any experts out there who can tell me how to re-arrange the output?

Thanks


Totally agree, that's actually why I'm here /sad.gif' class='bbc_emoticon' alt=':(' /> I'm not fussed (yet) about the column order but field names / column headings would be great!

#62   gregp

gregp
  • Members
  • 61 posts
  • Real Name:Greg

Posted 30 September 2008 - 03:41

Totally agree, that's actually why I'm here /sad.gif' class='bbc_emoticon' alt=':(' /> I'm not fussed (yet) about the column order but field names / column headings would be great!


Actually part of the problem is that the order to product relationship is a one to many (one order may have multiple products), but the csv result is a one to one (i.e. one line per order containing all product and customer details). So field names are obvious for the customer details but once you get further across you'd have to have things like product1, product2, product3 and so on which aren't actual field names in the database. So not quite as simple as it initially looks (to me anyway).

#63   deliciousmint

deliciousmint
  • Members
  • 5 posts
  • Real Name:katie mint
  • Gender:Female
  • Location:New Zealand

Posted 03 October 2008 - 00:38

Actually part of the problem is that the order to product relationship is a one to many (one order may have multiple products), but the csv result is a one to one (i.e. one line per order containing all product and customer details). So field names are obvious for the customer details but once you get further across you'd have to have things like product1, product2, product3 and so on which aren't actual field names in the database. So not quite as simple as it initially looks (to me anyway).


It is possible to have column headings and to have say customer details on one line and the items on individual lines below that. I've modified this to suit my needs, so it should be possible to do whatever you want. I can give you my code if that will help?

#64   cyberjorge

cyberjorge
  • Members
  • 24 posts
  • Real Name:cyberjorge
  • Gender:Male

Posted 04 October 2008 - 07:50

Hello guys!
I'm using the export order to csv contrib from this link that was also derived from this original addon:
http://www.oscommerc...tributions,4728

I really like this contrib because of the neat output, all columns are properly labeled and an option to output in CSV or HTML
However I'm having trouble making it work, all it does is refresh the page and no files are generated.

Is this a problem with MS2 and RCA version compatibility? Or just a problem in the code? Also it's hard coded but even manual changing the link gives more error.

Please I really need it, so I need all help so guys can offer.
Thanks a lot!

#65   cyberjorge

cyberjorge
  • Members
  • 24 posts
  • Real Name:cyberjorge
  • Gender:Male

Posted 07 October 2008 - 09:27

Hello guys!
I'm using the export order to csv contrib from this link that was also derived from this original addon:
http://www.oscommerc...tributions,4728

I really like this contrib because of the neat output, all columns are properly labeled and an option to output in CSV or HTML
However I'm having trouble making it work, all it does is refresh the page and no files are generated.

Is this a problem with MS2 and RCA version compatibility? Or just a problem in the code? Also it's hard coded but even manual changing the link gives more error.

Please I really need it, so I need all help so guys can offer.
Thanks a lot!


Anyone has a solution yet? As requested above it does have column header information, just the problem is making it work, as this just refreshes when clicked.

#66   cyberjorge

cyberjorge
  • Members
  • 24 posts
  • Real Name:cyberjorge
  • Gender:Male

Posted 10 October 2008 - 03:46

Anyone please?

Can we merge the function of:
http://www.oscommerc...tributions,4728

With this one instead? Can someone do that? so we can see the column headers and preview it first using html.
Thanks!

#67   Weilding

Weilding
  • Members
  • 5 posts
  • Real Name:Michael Weilding

Posted 21 November 2008 - 00:42

Hello there,

I really love this addon and it helps a lot with the automatic printing of labels etc etc. To make it perfect though I really need to export the order ATTRIBUTES and possibly the prices/taxes for my accounts. If anyone can help me with this I would be very greatful. I'm not a programmer so don't really know where to start.

Thanks! Mike

#68   havalok

havalok
  • Members
  • 4 posts
  • Real Name:Martin
  • Gender:Male

Posted 04 March 2009 - 11:39

Who can help me? This script was working well; and after a change to another server this great contribution isn't working anymore.

I have RC1

I can use the contrib but after pressing 'Generate' nothing is happening; only the url gives: export_orders_csv.php?start=800&end=850&status=&submitted=1

Does anyone have the same problem?



osCommerce export orders to csv file doesn't seem to work?

The contribution installed ok - but when I hit the 'Export to CSV' button nothing seemed to work, just a screen refresh

This was bugging me for a while - even on a vanilla v2.2 RC2a install...

Try this: create a text file called php.ini and in this file have one line of text:
register_globals=on

Upload this file to the root of your osCommerce installation - e.g. catalog/php.ini

That should do it

#69   thecandlespastore

thecandlespastore
  • Members
  • 52 posts
  • Real Name:Z
  • Gender:Female

Posted 08 March 2009 - 15:49

This contribution is not working very well. When I edited the customer.php file, my entire admin section disappeared. Then I switched to this contrib:

http://www.oscommerc...tributions,4728

And this part of the instructions does not make sense to me:
3. In admin/includes/boxes/reports.php, change this (or whichever line is NOT last in the menu):

// add export orders to csv
'<a href="' . tep_href_link(FILENAME_EXPORT_ORDERS_CSV, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_EXPORT_ORDERS_CSV . '</a><br>' .
// end export orders to csv

(change what??)

Because when I add that to my reports section I get multiple errors, one being
Parse error: syntax error, unexpected '}' in /home/zajanat/public_html/admin/includes/boxes/reports.php on line 28

When I remove the code my admin works again.
Always grateful for any help received!!

#70 ONLINE   geoffreywalton

geoffreywalton

    Professional Developer

  • Community Sponsor
  • 8,245 posts
  • Real Name:Geoffrey Walton
  • Gender:Male
  • Location:Norfolk, UK (close to the centre of the universe)

Posted 08 March 2009 - 16:49

You need to insert it into the middle of the list

'</a><br>' .
'<a href="' . tep_href_link


Change it to this

'</a><br>' .
// add export orders to csv
'<a href="' . tep_href_link(FILENAME_EXPORT_ORDERS_CSV, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_EXPORT_ORDERS_CSV . '</a><br>' .
// end export orders to csv
'<a href="' . tep_href_link


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

Virus Threat Scanner
My Contributions
Basic install answers.
Click here for Contributions / Add Ons.
UK your site.
Site Move.
Basic design info.

For links mentioned in old answers that are no longer here follow this link Useful Threads.

If this post was useful, click the Like This button over there ======>>>>>.

#71   thecandlespastore

thecandlespastore
  • Members
  • 52 posts
  • Real Name:Z
  • Gender:Female

Posted 08 March 2009 - 22:57

You need to insert it into the middle of the list



Change it to this


Thank you so much! I was inserting it under the second line instead of the first. Thank you for the help!
Always grateful for any help received!!

#72   minipassat

minipassat
  • Members
  • 81 posts
  • Real Name:minipassat

Posted 10 April 2009 - 00:38

It is possible to have column headings and to have say customer details on one line and the items on individual lines below that. I've modified this to suit my needs, so it should be possible to do whatever you want. I can give you my code if that will help?



Hello Katie,
I've read through this forum and didn't find any solution about this issue. It'll be great if you can share your code of how to export the column headinig (field name) on the .csv file. /biggrin.gif' class='bbc_emoticon' alt=':D' />

Also when a order has more than one items, anyone knows how to make the "BEGIN_ITEM" (product names) "END_ITEM" to the next row?

Thanks!!

#73   classico

classico
  • Members
  • 49 posts
  • Real Name:Jesper
  • Gender:Male
  • Location:Copenhagen

Posted 28 May 2009 - 12:06

Hi,

Have you found a solutions on how ot add the attributes to the order?

Thanks
Jesper




Hello there,

I really love this addon and it helps a lot with the automatic printing of labels etc etc. To make it perfect though I really need to export the order ATTRIBUTES and possibly the prices/taxes for my accounts. If anyone can help me with this I would be very greatful. I'm not a programmer so don't really know where to start.

Thanks! Mike



#74   steepedincode

steepedincode
  • Members
  • 36 posts
  • Real Name:steepedincode

Posted 30 May 2009 - 03:21

Just started using this contribution on a v2.2 RC1 store. Contrib works good. I made a simple sort order change to the drop-down lists and CSV output file to display orders in descending order.

To sort order descending in the range lists, on or about line 66 change:

$orders_list_query = tep_db_query("SELECT orders_id, date_purchased FROM orders ORDER BY orders_id");

to:

$orders_list_query = tep_db_query("SELECT orders_id, date_purchased FROM orders ORDER BY orders_id DESC");

With this change the following change is needed otherwise the CSV file won't display the orders at all. On or about line 118 change:

generatecsv($_GET['start'], $_GET['end']);

to

generatecsv($_GET['end'], $_GET['start']);

The orders now output in ascending sort order in CSV. The next change sorts the orders in descending order in the CSV output file. On or about line 140 change:

$orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires
FROM orders WHERE orders_id >= $start AND orders_id <= $end ORDER BY orders_id");

to:

$orders = tep_db_query("SELECT orders_id, date_purchased, customers_name, cc_owner, customers_company, customers_email_address, billing_street_address, billing_city, billing_state, billing_postcode, billing_country, customers_telephone, delivery_name, delivery_company, delivery_street_address, delivery_city, delivery_state, delivery_postcode, delivery_country, cc_type, cc_number, cc_expires
FROM orders WHERE orders_id >= $start AND orders_id <= $end ORDER BY orders_id DESC");

Appreciate any feedback or insights on potential issues with these changes.

QUESTIONS:
1. My client further wants the CSV file to display orders in COLS instead of ROWS. He's manually converting rows to cols in Excel, but is a way to change the CSV export to handle this?

2. Must second the request others here have made to export with field headings. Is this an easy change?

#75   galey1981

galey1981
  • Members
  • 99 posts
  • Real Name:David Gale

Posted 09 June 2009 - 18:17

2 quick questions to pose on this thread:

1) Is it possible to get product attributes feeding into the csv output? My supplier wants to get an order summary in a csv like this, but have all attributes listed too.

2) Again, is it possible to print column headings into the exported file?

#76   dvharrison

dvharrison
  • Members
  • 365 posts
  • Real Name:Deb
  • Gender:Female
  • Location:Essex, UK

Posted 10 June 2009 - 08:55

I have been using this but in order for it to do what we want I need to

a. get rid of all the whitespace and
b. when a client has bought more than 1 item, each product purchased needs to appear in a separate line.

Can anyone do this or can someone guide me into how to do this. I have basic PHP knowledge and pick things up very quickly.

Many thanks in advance

Edited by dvharrison, 10 June 2009 - 08:55.

Debbie Harrison

#77   dvharrison

dvharrison
  • Members
  • 365 posts
  • Real Name:Deb
  • Gender:Female
  • Location:Essex, UK

Posted 11 June 2009 - 09:58

I have found http://addons.oscommerce.com/info/4728 which does it with no whitespace, but for orders with more than 1 line I need them on a separate line with a separate transaction number.

Can anyone help with this, or even better, PM me with a quote for how much this would cost. /smile.gif' class='bbc_emoticon' alt=':)' />
Debbie Harrison

#78   galey1981

galey1981
  • Members
  • 99 posts
  • Real Name:David Gale

Posted 11 June 2009 - 15:11

I have found http://addons.oscommerce.com/info/4728 which does it with no whitespace, but for orders with more than 1 line I need them on a separate line with a separate transaction number.

Can anyone help with this, or even better, PM me with a quote for how much this would cost. /smile.gif' class='bbc_emoticon' alt=':)' />


Great find!!! And it adds headers to each of the columns. The only thing lacking now is product attributes. None of these show - anyone know how to get a column in to show what colour was picked and so on?

#79   steepedincode

steepedincode
  • Members
  • 36 posts
  • Real Name:steepedincode

Posted 11 June 2009 - 17:04

On the subject of enhancements. How can we get the weight of each item purchased added to the export?

#80   dvharrison

dvharrison
  • Members
  • 365 posts
  • Real Name:Deb
  • Gender:Female
  • Location:Essex, UK

Posted 12 June 2009 - 09:55

Great find!!! And it adds headers to each of the columns. The only thing lacking now is product attributes. None of these show - anyone know how to get a column in to show what colour was picked and so on?


Yes it was, but does anyone have any idea how I can achieve assigning an item idea for every additional line of an order?
Debbie Harrison