Re: Re: Order Export (for Mail Order Manager)

chris.cohen's picture
Offline
Joined: 09/08/2008
Juice: 17
Re: Re: Order Export (for Mail Order Manager)

After a little investigation, there is some code on lines 200-202 of uc_order_export.module that sets up a SQL query to get the orders to put in the list. Unless a sort_status has previously been set (lines 190-199), the code has the following clause:

WHERE o.order_status != 0

I'm not an expert on SQL, but the order_status column is a varchar (ie text) and this line is trying to compare it to a number. Removing the WHERE clause from the SQL statement gives a full list of orders, so this appears to fix the problem.

Original line 202:
.'ON o.order_status = os.order_status_id WHERE '. $status . (($sort == NULL) ? ' ORDER BY o.created DESC' : $sort);

Modified line 202:

.'ON o.order_status = os.order_status_id /*WHERE '. $status . '*/ ' . (($sort == NULL) ? ' ORDER BY o.created DESC' : $sort);

Due to the lack of any form of comments in this function's code, it is not clear to me why 'o.order_status != 0' was used. Perhaps the module's author can shed some light on this?

Order Export (for Mail Order Manager) By: spiderman (25 replies) Thu, 10/04/2007 - 17:05