When you take a look at the OS Commerce packing slip, you’ll see that it has a table for payment method, which seems kind of useless, especially if you use it as a packing slip / purchase order with your vendors. The thing the osCommerce packing slip really lacks of major importance is the shipping method. So in a very short summary, I’ll let you know how we added “Shipping Method” to the osCommerce packing slip.
REMEMBER. ALWAYS BACK UP!
First open admin/includes/functions/general.php
Before the closing ?> add this code:
function tep_get_orders_shipping_method($order_id) {
$check_order_query= tep_db_query(”select title from ” . TABLE_ORDERS_TOTAL . ” where orders_id=’” . $order_id . “‘ and class=’ot_shipping’”);
$check_order= tep_db_fetch_array($check_order_query);
if (SHOW_INVOICE_SHIPPING==’2′ and ($check_order['title']==’United Parcel Service’ or $check_order['title']==’United States Postal Service’)) {
// return short version on UPS and USPS
$short_shipping_end= strpos($check_order['title'], ”);
$short_shipping= substr($check_order['title'], 1, $short_shipping_end);
return $short_shipping;
} else {
// return normal shipping
return $check_order['title'];
}
}
Save the file.
Open admin/packingslip.php.
Find the line that says:
<td class=”main-payment”><b><?php echo ENTRY_PAYMENT_METHOD; ?></b> <?php echo $order->info['payment_method']; ?></td>
Change it to:
<td class=”main-payment”><b><?php echo ENTRY_SHIPPING_METHOD; ?></b> <?php echo tep_get_orders_shipping_method($oID); ?></td>
Open admin/includes/languages/english/packingslip.php and change ENTRY_PAYMENT_METHOD to ENTRY_SHIPPING_METHOD and change the wording to whatever you like.
Of course save all your files and you should have a kind of rough and tumble version of an osCommerce packing slip that shows the shipping method.
