Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

get all shippingcost from all orders.


Recommended Posts

how can i get all the shippingcost from all orders out and then sum them together.

i need this to calculate the shippingcost i add to my orders is somewhere around what i actualy pay for the shipping.


hope you understand what i mean..

do i find this in the sql. and how can such code look like

Link to comment
Share on other sites

i dont want a contribution. just a smal code to get shiping out of my sql and calculate the total of it.

i got the code figured out.


$shiping_query="SELECT SUM(value) FROM orders_total WHERE class LIKE 'ot_shipping'";

$shiping_result = mysql_query($shiping_query);

$shiping_price = mysql_fetch_row($shiping_result);



<td class="pageHeading">Total shipingfrom my orders: <? echo floatval($shiping_price[0]); ?>

Link to comment
Share on other sites


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

  • Create New...