VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: Simon A. on January 31, 2008, 19:34:49 PM

Title: Simon's hacked UPS module
Post by: Simon A. on January 31, 2008, 19:34:49 PM
Attached is a file which breaks out some of the UPS functionality in order to add extra flexibility.
use it something like this:

$ups = new ups();
ob_start ();    // suppress all output while fetching rates
$ups->populate_rates($order_weight, $source_zip, $country,
                        $postal_code, $tmparray);
ob_end_clean();            
foreach( $ups->shipment as $key => $value ) {                                 
   $serviceName = $value['ServiceName'];
   $cost = $value['TransportationCharges'];
        echo $serviceName.": ".$cost;
}

I've used this for two things:

1. showing approximate shipping charges before checkout
2. getting the shipping cost for Google Checkout's callback

It would be nice if all the other shipping modules could operate in a similar fashion.

(Note: I just got a message saying the upload folder was full, so I'll try to upload again later.)
Title: Re: Simon's hacked UPS module
Post by: Simon A. on February 04, 2008, 21:58:42 PM
Attached is the ups.php file

[attachment cleanup by admin]
Title: Re: Simon's hacked UPS module
Post by: outlawr1 on November 17, 2008, 23:32:20 PM
Ok exactly how can I impliment this, also, on orders that I am recieving a 0.00 shipping charge how can I make it pull the cost form the ETA results beside it an populate the shipping charge with that....