Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Where is shipping method stored? What file?


cgchris99

Recommended Posts

I am trying find out where the shipping method is stored.

If I print an invoice or packing slip, the shipping method is not displayed.

 

Where is this information stored and how can I display it on the invoices and packing slips.

 

thanks

Link to comment
Share on other sites

I'm not exactly sure how to pull it, but I do know that there is a copy stored in the mySQL database under the order_totals table and I believe that the admininvoice.php file just pulls the data in that relevent to the order number and cycles thorugh the table. That will give you the sub-total, tax, shipping, total. In my invoice.php file (2003/02/16 MS1) it is listed as:

  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

above is the querry, below is displays the order total info including shipping.

<?php

 for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {

   echo '          <tr>' . "n" .

        '<td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "n" .

        '<td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "n" .  '</tr>' . "n";

 }

?>

 

If this is what you are looking for, it would be kinda hard to display specifically the shipping info because the Title for that changes with each order. Mine will display UPS Ground (3lbs) or UPS Next Day Air (5lbs), so your not searching on a specific term, but on that changes constantly. Sorry :cry:

Hope this was helpful.

Link to comment
Share on other sites

I am trying this but the sizeof($order->totals) always comes back zero. I even went into the db and verified there are 3 records that should show up.

 

I'm new to php & osc. how does $order-totals know that it is dealing with the $orders_query?

 

shouldn't the query be using orders_total instead of TABLE_ORDERS?

 

thanks for any advice

Link to comment
Share on other sites

Sorry to tell you, but I'm kinda new too. I just did a search in the Admin dir and came up with the line in application_top.php:

  define('TABLE_ORDERS', 'orders');

now, follow me here. There is another define in apptop

('TABLE_ORDERS_TOTAL', 'orders_total');

at the top of invoice.php is a call to orders.php

in orders.php if you search for TABLE_ORDERS_TOTAL you get

      $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . tep_db_input($cID) . "' and o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

 

So I *think* this has to be where it is actually getting the order total from.

Link to comment
Share on other sites

  • 3 years later...
Sorry to tell you, but I'm kinda new too. I just did a search in the Admin dir and came up with the line in application_top.php:

  define('TABLE_ORDERS', 'orders');

now, follow me here. There is another define in apptop

('TABLE_ORDERS_TOTAL', 'orders_total');

at the top of invoice.php is a call to orders.php

in orders.php if you search for TABLE_ORDERS_TOTAL you get

	  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . tep_db_input($cID) . "' and o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";

So I *think* this has to be where it is actually getting the order total from.

 

 

 

ANY NEWS????

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...