
interchange-cvs at icdevgroup
May 14, 2008, 9:21 AM
Post #3 of 3
(80 views)
Permalink
|
User: heins Date: 2008-05-14 16:21:02 GMT Modified: dist/standard/products/ship shipping.asc Modified: lib/Vend/Ship QueryUPS.pm Log: * Remove QueryUPS shipping options from standard catalog, allow the module to be missing. Revision Changes Path 1.2 interchange/dist/standard/products/ship/shipping.asc rev 1.2, prev_rev 1.1 Index: shipping.asc =================================================================== RCS file: /var/cvs/interchange/dist/standard/products/ship/shipping.asc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- shipping.asc 25 Apr 2004 17:07:54 -0000 1.1 +++ shipping.asc 14 May 2008 16:21:02 -0000 1.2 @@ -259,46 +259,50 @@ max 9999999 cost e Too heavy for Book Rate -1DA: UPS Next Day Air - crit weight - at_least 5 - adder 2 - ui_ship_type UPSE:1DA - PriceDivide 1 - service 1DA - - min 0 - max 0 - cost e Nothing to ship! - - min 0 - max 1000 - cost s QueryUPS - - min 1000 - max 999999999 - cost e Too heavy for UPS - -2DA: UPS Second Day Air - crit weight - at_least 5 - adder 2 - ui_ship_type UPSE:2DA - PriceDivide 1 - service 2DA - aggregate 150 - - min 0 - max 0 - cost e Nothing to ship! - - min 0 - max 1000 - cost s QueryUPS - - min 1000 - max 999999999 - cost e Too heavy for UPS +## This mode will require Business::UPS module to be installed. It is in +## Bundle::InterchangeKitchenSink. +#1DA: UPS Next Day Air +# crit weight +# at_least 5 +# adder 2 +# ui_ship_type UPSE:1DA +# PriceDivide 1 +# service 1DA +# +# min 0 +# max 0 +# cost e Nothing to ship! +# +# min 0 +# max 1000 +# cost s QueryUPS +# +# min 1000 +# max 999999999 +# cost e Too heavy for UPS + +## This mode will require Business::UPS module to be installed. It is in +## Bundle::InterchangeKitchenSink. +#2DA: UPS Second Day Air +# crit weight +# at_least 5 +# adder 2 +# ui_ship_type UPSE:2DA +# PriceDivide 1 +# service 2DA +# aggregate 150 +# +# min 0 +# max 0 +# cost e Nothing to ship! +# +# min 0 +# max 1000 +# cost s QueryUPS +# +# min 1000 +# max 999999999 +# cost e Too heavy for UPS air_pp: US Postal Air Parcel crit weight 1.8 interchange/lib/Vend/Ship/QueryUPS.pm rev 1.8, prev_rev 1.7 Index: QueryUPS.pm =================================================================== RCS file: /var/cvs/interchange/lib/Vend/Ship/QueryUPS.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- QueryUPS.pm 9 Aug 2007 13:40:56 -0000 1.7 +++ QueryUPS.pm 14 May 2008 16:21:02 -0000 1.8 @@ -1,6 +1,6 @@ # Vend::Ship::QueryUPS - Interchange shipping code # -# $Id: QueryUPS.pm,v 1.7 2007-08-09 13:40:56 pajamian Exp $ +# $Id: QueryUPS.pm,v 1.8 2008-05-14 16:21:02 mheins Exp $ # # Copyright (C) 2002-2007 Interchange Development Group # Copyright (C) 1996-2002 Red Hat, Inc. @@ -29,11 +29,21 @@ use Vend::Interpolate; use Vend::Data; use Vend::Ship; -use Business::UPS; + +my $Have_Business_UPS; +eval { + require Business::UPS; + import Business::UPS; + $Have_Business_UPS = 1; +}; sub calculate { my ($mode, $weight, $row, $opt, $tagopt, $extra) = @_; + unless($Have_Business_UPS) { + do_error("Ship mode %s: Requires installation of Business::UPS", $mode); + } + $opt->{service} ||= $opt->{table}; if(! $opt->{service} and $extra =~ /^\w+$/) { $opt->{service} = $extra; _______________________________________________ interchange-cvs mailing list interchange-cvs[at]icdevgroup.org http://www.icdevgroup.org/mailman/listinfo/interchange-cvs
|