Re: ups quickcost [repost]

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 25089
interpreted = N
texte = Here is some webcat code that will generate a drop down menu of all UPS products and prices for a desintation, drop off point, weight and package type. In order for this code to work you will need a database of all country codes. and a small Convertchars database which converts % to |. I find it is easier to parse through a long string looking for | instead of %. I am not really sure why I converted chars in the first place, but it works. You will have to go in and modify certain parts which have hard coded values. This code was designed to work in a checkout so some of the values are variables being passed in a form. All the comment tags are placed there to prevent a ton of white space from being generated. It also uses another small database to convert UPS product codes into English words. I call this db shippingLookup.db. From the UPS website you should be able to find all the info needed to make create these Databases.Josh Tiger Pop Art LLC [HIDEIF [shipToBill]=true][text show=f]destCountry=[LOOKUP db=includes/UPS_country_codes.db&value=United States&lookInField=CountryName_H&returnField=CountryCode_H¬Found=ERROR][/ TEXT][/HIDEIF][!] [/!][SHOWIF [shipToBill]=true][text show=f]destCountry=[LOOKUP db=includes/UPS_country_codes.db&value=[Country]&lookInField=CountryName_H&r eturnField=CountryCode_H¬Found=ERROR][/TEXT][/SHOWIF][!] [/!][text show=f]destZip=[HIDEIF [shipToBill]=true][shipToZip][/HIDEIF][SHOWIF [shipToBill]=true][ZIP][/SHOWIF][/text][!] [/!][text show=f]residential=0[/text][!] [/!][text show=f]weight=[totalWeight][/text][!] [/!][text show=f]response=[middle startafter=UPSOnLine&endbefore=][tcpconnect host=www.ups.com&port=80][tcpsend]GET /using/services/rave/qcostcgi.cgi?accept_UPS_license_agreement=yes&10_action =4&14_origCountry=US&15_origPostal=90007&22_destCountry=[destCountry]&19_des tPostal=[destZip]&49_residential=[residential]&47_rate_chart=Regular+Daily+P ickup&48_container=00&13_product=GNDCOM&23_weight=[weight]&weight_std=lbs. HTTP/1.0 [UnURL]%0D%0A%0D%0A[/UnURL][/tcpsend][/tcpconnect][/middle][/text][!] [/!][math show=f]percentCount=0[/math][!] [/!][text show=f]response2=[convertchars db=includes/UPSconversions.db][response][/convertchars][/text][!] [/!][math show=f]errorCheck=0[/math][!] [/!][ListWords Words=[response2]&Delimiters=;][!] [/!][SHOWIF [word]~4][!] [/!][Math show=f]errorCheck = errorCheck + 1[/math][!] [/!][/SHOWIF][!] [/!][/LISTWORDS][!][/!][HIDEIF [errorCheck]=0][!][/!] [/HIDEIF]
[SHOWIF [errorCheck]=0] Sorry, but you have chosen an invalid shipping address. Most likely you have entered a zip/postal code which does not match the country. Please click your browser's back button and make the necessary corrections. [/SHOWIF] ----- Original Message ----- From: Aaron Lynch To: WebCatalog Talk Sent: Monday, December 06, 1999 9:18 AM Subject: Re: ups quickcost [repost] > Where? Are you talking about > http://www.ups.com/using/services/rave/rate.html ? > > my experience with webcat 3 is pretty limited, it > seems like it would be a lot harder to parse useful > info out of that result page, rather than using the > webcat snippet. I can't believe UPS makes their rates > this tough to comprehend... > > If that's not the script you refer to would you please > post a URL? > > Thanks > -aaron > > --- Nicolas Verhaeghe wrote: > > > hi all, > > > > > > I'm trying to use the ups snippet to get prices > > from > > > ups, and when I > > > RTFM for the > > > thing it say to refer to the ups documentation. > > Well, > > > I can't find _any_ > > > documentation on it. > > > > > > I looks like you may need a UPS account and > > download > > > the internet tool suite. > > > > Actually there is a script at UPS that only gives > > you the price of your > > shipment to a destination according to the weight, > > zip and country codes for > > origin and destination, and the code of the UPS > > product. > > > > No account necessary. > > > ===== > -Aaron > > __________________________________________________ > Do You Yahoo!? > Thousands of Stores. Millions of Products. All in one place. > Yahoo! Shopping: http://shopping.yahoo.com > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: ups quickcost [repost] (John Hill 1999)
  2. Re: ups quickcost [repost] (Aaron Lynch 1999)
  3. Re: ups quickcost [repost] (Aaron Lynch 1999)
  4. Re: ups quickcost [repost] (Aaron Lynch 1999)
  5. Re: ups quickcost [repost] (Nicolas Verhaeghe 1999)
  6. Re: ups quickcost [repost] (Josh Tiger 1999)
  7. Re: ups quickcost [repost] (Aaron Lynch 1999)
  8. Re: ups quickcost [repost] (Nicolas Verhaeghe 1999)
  9. Re: ups quickcost [repost] (Aaron Lynch 1999)
  10. Re: ups quickcost [repost] (Nicolas Verhaeghe 1999)
  11. ups quickcost [repost] (Aaron Lynch 1999)
Here is some webcat code that will generate a drop down menu of all UPS products and prices for a desintation, drop off point, weight and package type. In order for this code to work you will need a database of all country codes. and a small Convertchars database which converts % to |. I find it is easier to parse through a long string looking for | instead of %. I am not really sure why I converted chars in the first place, but it works. You will have to go in and modify certain parts which have hard coded values. This code was designed to work in a checkout so some of the values are variables being passed in a form. All the comment tags are placed there to prevent a ton of white space from being generated. It also uses another small database to convert UPS product codes into English words. I call this db shippingLookup.db. From the UPS website you should be able to find all the info needed to make create these Databases.Josh Tiger Pop Art LLC [HIDEIF [shipToBill]=true][text show=f]destCountry=[LOOKUP db=includes/UPS_country_codes.db&value=United States&lookInField=CountryName_H&returnField=CountryCode_H¬Found=ERROR][/ TEXT][/HIDEIF][!] [/!][SHOWIF [shipToBill]=true][text show=f]destCountry=[LOOKUP db=includes/UPS_country_codes.db&value=[Country]&lookInField=CountryName_H&r eturnField=CountryCode_H¬Found=ERROR][/TEXT][/SHOWIF][!] [/!][text show=f]destZip=[HIDEIF [shipToBill]=true][shipToZip][/HIDEIF][SHOWIF [shipToBill]=true][ZIP][/SHOWIF][/text][!] [/!][text show=f]residential=0[/text][!] [/!][text show=f]weight=[totalWeight][/text][!] [/!][text show=f]response=[middle startafter=UPSOnLine&endbefore=][tcpconnect host=www.ups.com&port=80][tcpsend]GET /using/services/rave/qcostcgi.cgi?accept_UPS_license_agreement=yes&10_action =4&14_origCountry=US&15_origPostal=90007&22_destCountry=[destCountry]&19_des tPostal=[destZip]&49_residential=[residential]&47_rate_chart=Regular+Daily+P ickup&48_container=00&13_product=GNDCOM&23_weight=[weight]&weight_std=lbs. HTTP/1.0 [unurl]%0D%0A%0D%0A[/UnURL][/tcpsend][/tcpconnect][/middle][/text][!] [/!][math show=f]percentCount=0[/math][!] [/!][text show=f]response2=[convertchars db=includes/UPSconversions.db][response][/convertchars][/text][!] [/!][math show=f]errorCheck=0[/math][!] [/!][ListWords Words=[response2]&Delimiters=;][!] [/!][SHOWIF [word]~4][!] [/!][Math show=f]errorCheck = errorCheck + 1[/math][!] [/!][/SHOWIF][!] [/!][/LISTWORDS][!][/!][HIDEIF [errorCheck]=0][!][/!] [/HIDEIF]
[SHOWIF [errorCheck]=0] Sorry, but you have chosen an invalid shipping address. Most likely you have entered a zip/postal code which does not match the country. Please click your browser's back button and make the necessary corrections. [/SHOWIF] ----- Original Message ----- From: Aaron Lynch To: WebCatalog Talk Sent: Monday, December 06, 1999 9:18 AM Subject: Re: ups quickcost [repost] > Where? Are you talking about > http://www.ups.com/using/services/rave/rate.html ? > > my experience with webcat 3 is pretty limited, it > seems like it would be a lot harder to parse useful > info out of that result page, rather than using the > webcat snippet. I can't believe UPS makes their rates > this tough to comprehend... > > If that's not the script you refer to would you please > post a URL? > > Thanks > -aaron > > --- Nicolas Verhaeghe wrote: > > > hi all, > > > > > > I'm trying to use the ups snippet to get prices > > from > > > ups, and when I > > > RTFM for the > > > thing it say to refer to the ups documentation. > > Well, > > > I can't find _any_ > > > documentation on it. > > > > > > I looks like you may need a UPS account and > > download > > > the internet tool suite. > > > > Actually there is a script at UPS that only gives > > you the price of your > > shipment to a destination according to the weight, > > zip and country codes for > > origin and destination, and the code of the UPS > > product. > > > > No account necessary. > > > ===== > -Aaron > > __________________________________________________ > Do You Yahoo!? > Thousands of Stores. Millions of Products. All in one place. > Yahoo! Shopping: http://shopping.yahoo.com > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Josh Tiger

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

search for all (1998) Almost a there but..bye bye NetCloak (1997) Just made store and move file from webcatalog......... (2000) Webmerchant PC auth (1998) WebCat with WebTen (1998) Security Issues and WebCommerce Solution (1997) FlushDatabase Suggestion (1998) How do I handle extra spaces? (2002) Emailer program? (2000) value in forms (2000) ShippingCosts (1998) [OT] SQL and Crackers (2000) RE: Languages (1997) [isfile] ? (1997) two domains and one cart and database (2000) financial calculation (2000) Off-Topic: Optimal WebSTAR settings for WebDNA plugin v4.5 (2002) WebCatalog NT beta 18 problem (1997) OFF-TOPIC: Check www.godaddy.com for me ... (2003) Doing what I can (2004)