Posted 30 May 2009 - 03:21 AM
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?