Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying Shipping method in order details


Silverado05

Recommended Posts

Hello,

 

I would like to display the shipping method on the orders details page. I have achieved to get the row and text where I want it. I just need it to display the shipping method use like it does with the payment method below.

 

See screen shot for example of what I would like to do. The red text is where I would like the shipping method used on the order to display.

 

If anyone can help me with this that would be great

 

shippingmethodqq3.png

 

 

-Thanks

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

I implemented it like so:

<tr>
 <td width="33%"> </td><td width="33%"> </td>
 <td width="15%"> <b><?php echo ENTRY_SHIPPING_METHOD; ?></b></td>
 <td><?php $shipping_method = tep_db_fetch_array(tep_db_query("SELECT title FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id='" . $oID . "' AND class='ot_shipping'"));
			   echo substr($shipping_method['title'],0,-1); // Remove final colon ?></td>
</tr>

Link to comment
Share on other sites

I figure it out thanks for the reply.

 

In admin/includes/classes/order.php

 

Insert this code around line 33 just after: $order = tep_db_fetch_array($order_query);

 

 $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
  $shipping_method = tep_db_fetch_array($shipping_method_query);

 

Also in order.php as above, add the code below into your $this->info = array at the bottom of the list before the );

 

 'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title']))

 

Then in admin/orders.php

 

find:

 

<tr>
		<td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
		<td class="main"><?php echo $order->info['payment_method']; ?></td>
	  </tr>

 

Above that add this:

 

 <tr>
		<td class="main"><b><?php echo ENTRY_SHIPPING_METHOD; ?></b></td>
		<td class="main"><?php echo $order->info['shipping_method']; ?></td>
	  </tr>
	  <tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
	  </tr>

 

 

Then in admin/includes/language/english/orders.php

 

find:

 

define('TEXT_INFO_PAYMENT_METHOD', 'Payment Method:');

 

below add:

 

define('TEXT_INFO_SHIPPING_METHOD', 'Shipping Method:');

 

 

That's it!

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...