Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Reports that include Postage


dasonix2000

Recommended Posts

Hi guys / gals.

 

Im wondering if you could point me to a contrib that does sales reports that include the cost of Shipping ?

 

I have spent a few days lookign but cant seem to find any. Currently all the reports I have tryed all show order total excluding postage :(

 

If you can help or point me in the right direction Thank you

 

Dasonix

Link to comment
Share on other sites

Hi guys / gals.

 

Im wondering if you could point me to a contrib that does sales reports that include the cost of Shipping ?

 

I have spent a few days lookign but cant seem to find any. Currently all the reports I have tryed all show order total excluding postage :(

 

If you can help or point me in the right direction Thank you

 

Dasonix

 

well, it is stored in the orders_total table so you would need to do a query on orders_id and class=ot_shipping and then pull the value or the text field.

Treasurer MFC

Link to comment
Share on other sites

well, it is stored in the orders_total table so you would need to do a query on orders_id and class=ot_shipping and then pull the value or the text field.

 

 

Thank you for the reply.

 

I think I have found what you are saying in the sales_report.php file in classes.

 

" $tmp_query = "select sum(ot.value) as shipping FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_shipping'"; "

 

Am I right and if so how do I get that called into stats_customers.php ?

 

Im a total Doof when it comes to PHP atm and this is a bit above my knowladge level. any more help would be wonderfull

 

TY

Link to comment
Share on other sites

Thank you for the reply.

 

I think I have found what you are saying in the sales_report.php file in classes.

 

" $tmp_query =  "select sum(ot.value) as shipping FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_shipping'"; "

 

Am I right and if so how do I get that called into stats_customers.php ?

 

Im a total Doof when it comes to PHP atm and this is a bit above my knowladge level. any more help would be wonderfull

 

TY

 

correct, simply re-use this code.

Treasurer MFC

Link to comment
Share on other sites

thnak you I think I have cracked it

 

in sales_report.php i changed the following

 

function query() {

$tmp_query = "select sum(ot.value) as value, avg(ot.value) as avg, count(ot.value) as count FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_subtotal'";

 

to

 

function query() {

$tmp_query = "select sum(ot.value) as value, avg(ot.value) as avg, count(ot.value) as count FROM " . TABLE_ORDERS_TOTAL . " ot, " . TABLE_ORDERS . " o WHERE ot.orders_id = o.orders_id and ot.class = 'ot_total'";

 

everythign seems to be right.

 

for anybody who ever needs this hack just take the sub out of the ot_subtotal.

 

thank you for your guidence, hopefully this wont mess things up too much :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...