Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Posts
    143
    Plugin Contributions
    0

    Default Automated UPS Tracking

    After using this forum for several years to find assistance and answers, i think i finally might have something worthwhile to share. for awhile now we have been researching the best way to communicate UPS tracking information to our customers. until now, the best solutions i've found were:
    ~ copy/paste each tracking number into zen manually.
    ~ have UPS quantum view or something similar email the customer automatically, which does the job, but in my opinion doesn't look as professional as i would like
    ~ implement some type of importing from worldship (for example, export tracking numbers to csv file and import into zen)

    well, i wasn't thrilled with any of these options. now, we have found a way to provide a customer with a tracking link automatically, without having to copy/paste or import/export anything from Worldship. If you're interested, read on:

    While focusing on how to get the tracking numbers into ZenCart, it escaped my mind that you can track a package without having the tracking number. UPS provides tracking tools that allow you to track by various criteria, including Date Range, Package Reference, Shipper Number and more. So, when preparing a shipment for UPS, you must enter the zen invoice number in a "Reference" field. doesn't matter which one (ups allows up to 5 i think). The only catch is that it must be exactly the same, and must be the only thing in the reference field. For example, if the invoice number is 1212, you must enter 1212 in the reference field. if you put inv#1212, or #1212, or 1212W or anything that is not an exact match, it will not work.

    next, we added the ups tracking code to whatever areas of the website we want to use them in (in this case, i've added to the tpl_account_default.php page.) Please note that you will need a UPS account, and you will need to register at ups.com to receive an HTML License to use below.

    in tpl_account_default.php, find the following lines:

    PHP Code:
    <th scope="col"><?php echo TABLE_HEADING_VIEW?></th>
    below it add:

    PHP Code:
    <th scope="col"><?php echo 'Track'?></th>
    next, find:

    PHP Code:
    <td align="right"><?php echo '<a href="' zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO'order_id=' $orders['orders_id'], 'SSL') . '"> ' 
    zen_image_button(BUTTON_IMAGE_VIEW_SMALLBUTTON_VIEW_SMALL_ALT) . '</a>'?></td>
    underneath it, add:

    HTML Code:
    <td>
    <?php 
    $invoice = $orders['orders_id'] ;
    if ($orders['orders_status_name'] == 'Shipped') {
    ?><FORM method="post" action = "http://wwwapps.ups.com/WebTracking/OnlineTool" target="_blank">
    <INPUT type="hidden" size=35 maxlength="35" name="InquiryNumber" value=<?php echo $invoice?>>
    <INPUT type="hidden" size=10 maxlength="10" name="SenderShipperNumber" value="YOUR_UPS_ACCOUNT#">
    <INPUT type="hidden" name="UPS_HTML_License" value="YOUR_HTML_LICENSE_KEY_OBTAINED_FROM_UPS">
    <INPUT type="hidden" name="UPS_HTML_Version" value="3.0">
    <INPUT type="hidden" name="TypeOfInquiryNumber" value="R">
    <input type="image" src="images/track_ups3.gif" value="submit" alt="submit">
    </FORM><?php ; }
    ?></td>
    this sends a request to UPS based on your account number, and asks it to find any packages that have a reference number matching this invoice number. as long as you have properly noted the invoice number in UPS when preparing the shipment, you should see a nice ups tracking page appear. (note, the if statement above uses an order status called 'Shipped', so that the tracking link is only displayed for orders that have already shipped. if you have different order status names, you'll need to change that line to match your setup or delete the if statement altogether. We've used almost identical code on the orders.php page, let me know if anyone needs that code for guidance.

    not sure how many people will find this helpful, but it's been GREAT for us. customers love it and the staff loves it. the main snag is that the info displayed is only as good as the info being entered - meaning if you forget to reference the invoice number on the package, the tracking will not work. that being said, our warehouse was already in the habit of referencing the invoice number (as i'm sure many are), so it wasn't an issue. the code is also looking for an icon calls track_ups3.gif which needs to be added to your images/ folder. i have attached an example, or you can make your own (or use text instead).

    ps - if anyone is wondering, i did contact UPS Tech to confirm that the HTML Access Key wasn't anything sensitive that couldn't be viewed publicly. i was assured that unless your UPS username and password are exposed, the HTML License poses no security threats.

    i'd love any comments or feedback. while i don't consider myself very skilled with php, i'll try my best to assist anyone who is trying to implement this. Also, after thinking about this problem/solution for so long - this seems so very simple, i'm not sure how we overlooked it. i guess that begs the question, is it too good to be true? could someone familiar with ups/zen take a peek and let me know if i'm missing something huge here. we've been using on 2 live sites for about a week now and it seems to be doing great.

    i take no responsibility for the effects of this code on your cart. as always, perform backups before making changes, and test before using on a live cart.

    -Joe
    Attached Images Attached Images  

  2. #2

    Default Re: Automated UPS Tracking

    Wow this is excellent! Thanks!

    Unfortunatly we ship the vast majority of our packages
    via Fedex.

    Any idea for a similiar solution with Fedex?

    Thanks,
    Mike

  3. #3
    Join Date
    Oct 2007
    Posts
    143
    Plugin Contributions
    0

    Default Re: Automated UPS Tracking

    malice,
    fedex does allow you to track packages by reference number, it's just a matter of finding the code or link used to do so. we stopped using them awhile back, so i don't have my password handy, which you need to access the developer docs. in any event - if you are able to find the code that sends a tracking request by reference to fedex - you could easily plug it into the pages the same way i did above. maybe google around for fedex tracking reference code or just ask your account rep or fedex support.

    joe

  4. #4
    Join Date
    Aug 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: Automated UPS Tracking

    Hi Joe
    Question - we are looking to update our customer cart status from Processing - Shipped - In Transit - Delivered , etc. Right now we have to do this manually by looking up the tracking url for each order. Does your solution address updating the statuses within the cart? If not, have you run into other solutions that do this?

  5. #5
    Join Date
    Oct 2007
    Posts
    143
    Plugin Contributions
    0

    Default Re: Automated UPS Tracking

    unfortunately our tracking code doesn't address the "order status" update.. although that's an interesting thought..

    currently we do that part manually.. when the warehouse sends the paperwork back into the office, we go through and update the status to "Shipped" (changed the default of "delivered").. we do use the super orders mod "batch status update" to save some time, but it's not an ideal solution.

  6. #6
    Join Date
    Aug 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: Automated UPS Tracking

    Currently we print our shipping labels in PayPal and this action generates the order tracking url. We take this url from PayPal, paste it into the customer's order in zen cart, and update the order status from "Processing" to "Shipping Update".

    I was thinking of a solution that would periodically (say every 30 minutes or hour) send a query to usps, ups, fedex, dhl including the tracking string url for all orders that are in "Shipping Update" or beyond it. If there was new tracking information, the program would update the zen cart customer status with exact wording of the new status and send a Shipping Update email from the cart as normal. If no new status was available, then no action (update) would be taken.

    I've been looking on this forum for something like this, but haven't had any luck finding something like this. I know Magento offers this functionality straight out of the box, so I may look at their code to see how they've managed to make this happen.

    What does Super Orders do? If it allows us to bypass the shipping label printing from PayPal, then it may get us closer to querying the tracking information and knock out the manual process of copying and pasting the tracking url into our cart.

    Thanks in Advance!

 

 

Similar Threads

  1. UPS tracking
    By pazdar in forum General Questions
    Replies: 1
    Last Post: 13 Jan 2012, 04:21 PM
  2. Getting rid of automated Fake Customer sign ups?
    By dgent in forum Managing Customers and Orders
    Replies: 6
    Last Post: 2 Jun 2011, 09:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg