WordPress WP eCommerce UPS Shipping

I am using wordpress and wp eCommerce for my products, I am using UPS for shipping and I created an account with UPS and got the API and information I have entered under shipping is correct and I have checked all the right boxes.

I know that the UPS Shipping only does the calculations, however is there a way so when a user places an order, it goes into My UPS account with a tracking number or something similar. I got an email back from wp-ecommerce saying this

Read More

You would ship the product the way you would regardless of having the online store. In most cases this means going to your UPS system and creating a shipping label. At this point you will be provided a tracking number that you can then enter into the store sales log for that order. A notice will then be delivered to the person with the tracking information.

Is that the best way to do my shipping or does anyone have a better idea?

Thanks,
J

Related posts

Leave a Reply

2 comments

  1. My two cents: after beginning to follow @c2h50h’s solution (great find, btw!), I realized that PayPal has a print shipping label option and integrates seamlessly with your UPS account. My client uses PayPal Pro (which is their $30/month white label payment solution), and the shipping information transfers automatically to PayPal, where you can print labels after implementation. Note: this should also work with other PayPal (free) platforms.

    While I got @c2h50h’s solution working in testing, I realized there would be a lot of coding to create a viable plugin for the client. They love the PayPal solution, though, and I have to admit, I’d be hard pressed to design something better/more reliable for their WordPress admin page.

    Here’s instructions in case you want to go this route:

    1. Sign up for PayPal Pro
    2. Next, add your PayPal API info to WP E-Commerce: How to find PayPal API credentials
    3. After setting this up, log into PayPal Account.
    4. On account page beside your order, click “Print Shipping Label.”
    5. Add UPS account (or USPS)
    6. Client can print shipping labels from PayPal and charge to either their PayPal or UPS account.
    7. Put tracking number into WP E-Commerce.

    Pretty easy.

  2. This is the only way available for WP eCommerce at the moment:

    I am unaware of any WP plugin that does anything but fetching shipping rates from UPS – you’d have to get someone to write you custom plugin that can also generate shipping digest and submit it to UPS to get a shipping label.

    Here’s some code you could start with to make such a plugin

    $xmlRequest1='<?xml version="1.0" encoding="ISO-8859-1"?>
    <AccessRequest>
    <AccessLicenseNumber>ACCESS LICENCE NUMBER</AccessLicenseNumber>
    <UserId>UPS USERNAME</UserId>
    <Password>UPS PASSWORD</Password>
    </AccessRequest>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ShipmentAcceptRequest>
    <Request>
    <TransactionReference>
    <CustomerContext>Customer Comment</CustomerContext>
    </TransactionReference>
    <RequestAction>ShipAccept</RequestAction>
    <RequestOption>1</RequestOption>
    </Request>
    <ShipmentDigest>SHIPMENT DIGEST</ShipmentDigest>
    </ShipmentAcceptRequest>
    ';
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://wwwcie.ups.com/ups.app/xml/ShipAccept");
    // uncomment the next line if you get curl error 60: error setting certificate verify locations
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    // uncommenting the next line is most likely not necessary in case of error 60
    // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 3600);
    
    //if ($this->logfile) {
    //   error_log("UPS REQUEST: " . $xmlRequest . "n", 3, $this->logfile);
    //}
    $xmlResponse = curl_exec ($ch); // SHIP ACCEPT RESPONSE
    //echo curl_errno($ch);
    
    $xml = $xmlResponse;
    
    preg_match_all( "/<ShipmentAcceptResponse>(.*?)</ShipmentAcceptResponse>/s",
    $xml, $bookblocks );
    
    foreach( $bookblocks[1] as $block )
    {
    preg_match_all( "/<GraphicImage>(.*?)</GraphicImage>/",
    $block, $author ); // GET LABEL
    
    preg_match_all( "/<TrackingNumber>(.*?)</TrackingNumber>/",
    $block, $tracking ); // GET TRACKING NUMBER
    //echo( $author[1][0]."n" );
    }
    
    echo '<img src="data:image/gif;base64,'. $author[1][0]. '"/>';
    

    Code source: http://webcollage.wordpress.com/2011/05/13/ups-label-print-with-php/

    And here http://webcollage.wordpress.com/2011/05/10/ups-shipping-confirmation-code-in-php/ you’ll find how the shipping digest looks like