.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Vend::Ship::QueryUPS 3pm" .TH Vend::Ship::QueryUPS 3pm "2010-03-25" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Vend::Ship::QueryUPS \-\- calculate UPS costs via www .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& (catalog.cfg) \& \& Shipping QueryUPS default_geo 45056 \& \& (shipping.asc) \& ground: UPS Ground Commercial \& origin 45056 \& service GNDCOM \& \& min 0 \& max 0 \& cost e Nothing to ship! \& \& min 0 \& max 150 \& cost s QueryUPS \& \& min 150 \& max 99999999 \& cost e Too heavy for UPS. .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Calculates \s-1UPS\s0 costs via the \s-1WWW\s0 using Business::UPS. .PP To activate, configure any parameter in catalog.cfg. A good choice is the default origin zip. .PP Options: .IP "weight" 4 .IX Item "weight" Weight in pounds. Required \*(-- normally passed via \s-1CRIT\s0 parameter. .IP "service" 4 .IX Item "service" Any valid Business::UPS mode (required). Example: 1DA,2DA,GNDCOM. Defaults to the mode name. .IP "geo" 4 .IX Item "geo" Location of field containing zip code. Default is 'zip'. .IP "country_field" 4 .IX Item "country_field" Location of field containing country code. Default is 'country'. .IP "default_geo" 4 .IX Item "default_geo" The \s-1ZIP\s0 code to use if none supplied \*(-- for defaulting shipping to some value in absence of \s-1ZIP\s0. No default \*(-- will return 0 and error if no zip. .IP "default_country" 4 .IX Item "default_country" The country code to use if none supplied \*(-- for defaulting shipping to some value in absence of country. Default \s-1US\s0. .IP "aggregate" 4 .IX Item "aggregate" If 1, aggregates by a call to weight=150 (or \f(CW$Variable\fR\->{\s-1UPS_QUERY_MODULO\s0}). Multiplies that times number necessary, then runs a call for the remainder. In other words: .Sp .Vb 1 \& [ups\-query weight=400 mode=GNDCOM aggregate=1] .Ve .Sp is equivalent to: .Sp .Vb 5 \& [calc] \& [ups\-query weight=150 mode=GNDCOM] + \& [ups\-query weight=150 mode=GNDCOM] + \& [ups\-query weight=100 mode=GNDCOM]; \& [/calc] .Ve .Sp If set to a number above 1, will be the modulo to do repeated calls by. So: .Sp .Vb 1 \& [ups\-query weight=400 mode=GNDCOM aggregate=100] .Ve .Sp is equivalent to: .Sp .Vb 6 \& [calc] \& [ups\-query weight=100 mode=GNDCOM] + \& [ups\-query weight=100 mode=GNDCOM] + \& [ups\-query weight=100 mode=GNDCOM] + \& [ups\-query weight=100 mode=GNDCOM]; \& [/calc] .Ve .Sp To aggregate by 1, use .999999. .IP "cache_table" 4 .IX Item "cache_table" Set to the name of a table (default ups_cache) which can cache the calls so repeated calls for the same values will not require repeated calls to \s-1UPS\s0. .Sp Table needs to be set up with: .Sp .Vb 4 \& Database ups_cache ship/ups_cache.txt _\|_SQLDSN_\|_ \& Database ups_cache AUTO_SEQUENCE ups_cache_seq \& Database ups_cache DEFAULT_TYPE varchar(12) \& Database ups_cache INDEX weight origin zip shipmode country .Ve .Sp And have the fields: .Sp .Vb 1 \& code weight origin zip country shipmode cost updated .Ve .Sp Typical cached data will be like: .Sp .Vb 5 \& code weight origin zip country shipmode cost updated \& 14 11 45056 99501 US 2DA 35.14 1052704130 \& 15 11 45056 99501 US 1DA 57.78 1052704130 \& 16 11 45056 99501 US 2DA 35.14 1052704132 \& 17 11 45056 99501 US 1DA 57.78 1052704133 .Ve .Sp Cache expires in one day.