Add Shipping Method To Packing Slips In osCommerce

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>&nbsp;<?php echo $order->info['payment_method']; ?></td>

Change it to:

<td class=”main-payment”><b><?php echo ENTRY_SHIPPING_METHOD; ?></b>&nbsp;<?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.

Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website,

Magento is amazing! If we weren’t in so deep, we would probably never use it for anything except an ashtray! I don’t smoke so how about a boat anchor? I don’t have a boat, but you know what, I have a dog that cr#ps and p@es, how bout that? I could save some money on puppy pads!

We were just in the process of deleting a website from a multi store installation of Magento. After doing the delete, EVERY instance of our Magento sites, including the admin gave an error! This is from a live site, with thousands of products supplying our sole source of income, literally hundreds of thousands of dollars! The error message we got was

Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website,

After doing some research, we found someone that had discovered that if you delete the file app/etc/use_cache.ser it fixes the problem!

Magento sucks, but it seems to be such a great ecommerce site otherwise.
What can you do?!?!?!?

Packing Slip Size In Magento Too Big

I’ve heard some people complain about the size of the stock Magento Packing Slip. Many times, the file size exceeds 600k, which is pretty ridiculous, especially for a simple PDF file. So we’ve often seen the question “How to reduce the file size of a Magento Packing Slip

Here’s our “cheat” for getting around this issue:

  1. When you receive an order, go to your Admin section of Magento and go to Sales > Orders.
  2. Select the order you want to create the packing slip for. I know I saw a comment on our website that said Magento only creates a packing slip when the order is “Complete”, but that is not true. Magento creates a packing slip when you ship the product(s).
  3. Select the “Ship” button from the “Order Information” panel. This takes you to the “Shipments” page. Select the “Submit Shipment” button near the bottom of the page.
  4. Under the “Shipments” section, select the “Print” button near the top.
  5. Magento automatically creates the packing slip for you in PDF format. This is the file we are referring to in the beginning of this article.
  6. By default, at least on our computers (we are die hard Mac users and will never change), Magento opens that PDF file for your viewing.
  7. Now here is our “cheat”. When you have the Magento PDF open, select print, however you might do that on your computer, but instead of printing it out with your printer, save it as a PDF. We like to save ours with a name in this format: storename-todays date-customername. We then save that in our “packingslips” folder on our local drive and voila, you have an easy to find packing slip for your Magento order, and on our computer, the file is only around 40-60k!
  8. On a Mac, the original Magento packing slip is saved to our downloads folder, so we simply go in later and trash all of our original packing slips, freeing up over 600k per file

That’s it, our easy to use and understand fix to reduce Magento packing slip size along with making an easy way to manage the processing of our orders, and we never had to touch a single Varien / Magento file!

A Valuable Way To Promote Your Magento Store

This really doesn’t relate to a Magento problem, but thought we might mention it any way. Most everybody probably knows, but Wordpress is a great open source blog software that can double as a great website CMS. Quite flexible and easy to use, Wordpress is great for creating a blog related to your Magento site or even a supplemental site to help feed traffic to your Magento site or osCommerce site. We’re still working on ours for our sites, but we did just complete a customer website and news blog. The site is for ALMS race team, Genoa Racing. They haven’t had a website in years, so it’s been a bit of a challenge getting Google to find them, but we’re now making great progress. Without Wordpress, it would have been a much more tedious job.

Thought we’d throw that out there for anyone that wants an easy solution to promoting their Magento site or osCommerce site or any other site for that matter.