Jump to content
Sign in to follow this  
Dr_DK

Order Totals: Total $ and Total Sales Count

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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 by bimbachetuning

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×