Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Order Totals: Total $ and Total Sales Count


Dr_DK

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!

Link to comment
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
Link to comment
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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...