Dr_DK Posted April 18, 2007 Share Posted April 18, 2007 Hello all... Please post any questions in this forum related to my contribution: Order Totals: Total $ and Total Sales Count. I will try to keep up with it. Thank you. Contribution URL: Order Totals: Total $ and Total Sales Count Quote Link to comment Share on other sites More sharing options...
Dr_DK Posted April 18, 2007 Author Share Posted April 18, 2007 This is an answer or "Add-On" requested from Bimbachetuning ------------------------------------------------------------------------ I make a question: Its possible define only a status orders total? I would see only the totals in "finished" orders, and no in all status orders. Thnks a lot for the orders mod. P.D.: Sorry my bad english, im spanish ;) ------------------------------------------------------------------------ Answer: Simply replace the line 385 with this: $orders_total_query = tep_db_query("select ot.orders_id, sum(ot.value) as total_sales, count(ot.value) as total_orders, ot2.orders_status_id from " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS_STATUS_HISTORY . " ot2 where class = 'ot_total' and ot.orders_id = ot2.orders_id and ot2.orders_status_id = 2 GROUP by ot2.orders_id"); Enjoy! Quote Link to comment Share on other sites More sharing options...
bimbachetuning Posted April 18, 2007 Share Posted April 18, 2007 (edited) Hi again Dr DK, thnks for your answer, but the mod dont work correctly for me. If im in admin/orders.php, and i change the Status selection: (orders.php?status=1, orders.php?status=2, orders.php?status=3, orders.php?status=......), my "AVARAGE ORDER:" its always the same. Im only interested in know the orders.php?status=3, but its more interesting can change the status and view the avarage order in every status. Thnks a lot again! P.D.: Sorry again, im spanish ;) Edited April 18, 2007 by bimbachetuning Quote Link to comment Share on other sites More sharing options...
cactustactical Posted April 20, 2007 Share Posted April 20, 2007 I think what is being asked here is that it would be nice to have summary level data such as you are providing based on the order status that is being displayed. The way the code is written, it will always sum the order count and dollar amount whether a person is looking at all order statuses or looking at orders that are in a specific status, Pending orders, for example. It would be nice to know how many orders and the value of the orders in Processing status, for example. The earlier answer provided does not do that. Any thoughts? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.