Re[3]: Putting a page between checkout and invoice

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 25618
interpreted = N
texte = On 12/16/99 4:47 PM, jpeacock@univpress.com at jpeacock@univpress.com wrote:> I don't see any reason that moving the [setheader] should have a problem.... > > Did you try and copy your entire [setheader] context from the invoice.tpl page > to a point on the sitelicense.tpl _above_ the redirect section? It must be > above because otherwise WebCat will never get there.John: I gave this method (doing the [setheader] on my intervening page) a shot today as I could foresee other headaches when passing things via command (as I have to do with my redirect). Yep, I put the [setheader] before my [redirect].In the storebuilder example, there's lots of [setheader] commands at the top of invoice. Maybe I didn't bring all of them over the time before, but I did this time. If I order no software, the redirect works great and the header is set properly and everything seems to work... nice and transparent to the buyer.However, now my calculations for the site license don't work. If I order a font, I enter # of workstations and # of printers, then it takes me to invoice instead of looping back to sitelicense.tpl. It takes me there with a command URL, so my redirect is being tripped the second time through.I'm posting my code so someone can hopefully point out my mistake. I'll continue to look at it as well: I didn't have as much time as I would have liked to do it. Thanks.--------code starts here-----------[math show=f]costfnts=0[/math] [math show=f]numcpus=0[/math] [math show=f]rndcpus=0[/math] [!] more math definitions removed here for brevity [/!][!]open orderfile context, loop through lineitems in cart [/!] [!]only the first time through this form, not on 2nd time through [/!][showif [costfnts]=0] [orderfile cart=[cart]][!] FOLLOWING SETHEADERS COME FROM invoice.tpl CREATED BY STOREBUILDER [/!] [setheader cart=[cart]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [setheader cart=[cart]]cartIPAddress=[url][ipaddress][/url]&precision=[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value ¬found=2][/setheader] [setheader cart=[cart]]header40=[showif [sameasship]=T]T[/showif][hideif [sameasship]=T]F[/hideif][/setheader] [!]Set Tax Rate[/!] [!]Check state database first, set to 0 if not found[/!] [setheader cart=[cart]]taxRate=[lookup db=admin/states.db&lookinfield=ST_ABRV&value=[shiptostate]&returnfield=ST_TA X¬found=0][/setheader] [!]Check zip code database last, override if found[/!] [search db=admin/zips.db&Z_STARTtype=[lookup db=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&leZ_STARTda tarq=[url][shiptozip][/url]&Z_ENDtype=[lookup db=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&geZ_ENDdata rq=[url][shiptozip][/url]] [founditems][setheader cart=[cart]]taxRate=[Z_TAX][/setheader][/founditems] [/search] [!] SETHEADER I USE TO SPECIFY A FIXED SHIP AMOUNT [/!] [setheader cart=[cart]]shipcost=[math][lookup db=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT] -2[/math][/setheader] [showif [header40]=T] [setheader cart=[cart]][formvariables name=__ShipTo&exact=F][getchars start=9][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [/showif] [!]END SETHEADERS FROM INVOICE.TPL[/!][lineitems][!] if a line item ends in FO, then it's a font and include it in the base font price [/!][showif [GetChars start=1&end=2&from=end][SKU][/GetChars]=FO][math show=f]costfnts=[costfnts]+[price][/math][/showif][/lineitems] [/orderfile] [/showif][!] go to invoice if they have ordered no fonts [/!] [showif [costfnts]=0][redirect invoice.tpl?cart=[cart]&__shipvia=[__shipvia]][/showif] [!] I should get rid of ^^^^^^^^^ this now that I'm setting header [/!] [!] but left it in; don't think it should matter [/!][!] hide this if they've entered numcpus and have posted their entries [/!] [hideif [numcpus]>0]
[include file=sitelicenselegal.inc]

Number of workstations:

Number of printers:

[/hideif][!] do these things if they HAVE entered info [/!] [showif [numcpus]>0]

Your site license information:

Cost of fonts: $[costfnts]
Number of CPUs: [numcpus]
Number of printers: [numprt]


[!] calculate charge [/!][!] LOTS of calculations removed here for brevity[/!] [!] basically taking [numcpus] and [numprt] and [costfnts] [/!] [!] and coming up with a CPUsurcharge and a printer surcharge [/!] [!] User is charged whichever is more [/!]

Additional surcharge (printers only): $[totprtsur]
Additional surcharge (CPUs): $[totcpusur][showif [totcpusur]>[totprtsur]][math show=f]finalsur=[totcpusur][/math][/showif] [showif [totprtsur]>[totcpusur]][math show=f]finalsur=[totprtsur][/math][/showif] [showif [totprtsur]=[totcpusur]][math show=f]finalsur=[totprtsur][/math][/showif]

FINAL SURCHARGE: $[finalsur]

[/showif]-------- end code ----------- Chris Vargas The whole scene had an eerie, surreal or quality, like when you're on vacation in another city and 'Jeopardy' comes or on at 7 instead of 7:30. http://www.chrisandmaria.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 Associated Messages, from the most recent to the oldest:

    
  1. Re[3]: Putting a page between checkout and invoice (Chris Vargas 1999)
On 12/16/99 4:47 PM, jpeacock@univpress.com at jpeacock@univpress.com wrote:> I don't see any reason that moving the [setheader] should have a problem.... > > Did you try and copy your entire [setheader] context from the invoice.tpl page > to a point on the sitelicense.tpl _above_ the redirect section? It must be > above because otherwise WebCat will never get there.John: I gave this method (doing the [setheader] on my intervening page) a shot today as I could foresee other headaches when passing things via command (as I have to do with my redirect). Yep, I put the [setheader] before my [redirect].In the storebuilder example, there's lots of [setheader] commands at the top of invoice. Maybe I didn't bring all of them over the time before, but I did this time. If I order no software, the redirect works great and the header is set properly and everything seems to work... nice and transparent to the buyer.However, now my calculations for the site license don't work. If I order a font, I enter # of workstations and # of printers, then it takes me to invoice instead of looping back to sitelicense.tpl. It takes me there with a command URL, so my redirect is being tripped the second time through.I'm posting my code so someone can hopefully point out my mistake. I'll continue to look at it as well: I didn't have as much time as I would have liked to do it. Thanks.--------code starts here-----------[math show=f]costfnts=0[/math] [math show=f]numcpus=0[/math] [math show=f]rndcpus=0[/math] [!] more math definitions removed here for brevity [/!][!]open orderfile context, loop through lineitems in cart [/!] [!]only the first time through this form, not on 2nd time through [/!][showif [costfnts]=0] [orderfile cart=[cart]][!] FOLLOWING SETHEADERS COME FROM invoice.tpl CREATED BY STOREBUILDER [/!] [setheader cart=[cart]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [setheader cart=[cart]]cartIPAddress=[url][ipaddress][/url]&precision=[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value ¬found=2][/setheader] [setheader cart=[cart]]header40=[showif [sameasship]=T]T[/showif][hideif [sameasship]=T]F[/hideif][/setheader] [!]Set Tax Rate[/!] [!]Check state database first, set to 0 if not found[/!] [setheader cart=[cart]]taxRate=[lookup db=admin/states.db&lookinfield=ST_ABRV&value=[shiptostate]&returnfield=ST_TA X¬found=0][/setheader] [!]Check zip code database last, override if found[/!] [search db=admin/zips.db&Z_STARTtype=[lookup db=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&leZ_STARTda tarq=[url][shiptozip][/url]&Z_ENDtype=[lookup db=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&geZ_ENDdata rq=[url][shiptozip][/url]] [founditems][setheader cart=[cart]]taxRate=[Z_TAX][/setheader][/founditems] [/search] [!] SETHEADER I USE TO SPECIFY A FIXED SHIP AMOUNT [/!] [setheader cart=[cart]]shipcost=[math][lookup db=admin/shippers.db&lookinfield=SHR_ID&value=[shipVia]&returnfield=SHR_AMT] -2[/math][/setheader] [showif [header40]=T] [setheader cart=[cart]][formvariables name=__ShipTo&exact=F][getchars start=9][name][/getchars]=[url][value][/url]&[/formvariables][/setheader] [/showif] [!]END SETHEADERS FROM INVOICE.TPL[/!][lineitems][!] if a line item ends in FO, then it's a font and include it in the base font price [/!][showif [GetChars start=1&end=2&from=end][SKU][/GetChars]=FO][math show=f]costfnts=[costfnts]+[price][/math][/showif][/lineitems] [/orderfile] [/showif][!] go to invoice if they have ordered no fonts [/!] [showif [costfnts]=0][redirect invoice.tpl?cart=[cart]&__shipvia=[__shipvia]][/showif] [!] I should get rid of ^^^^^^^^^ this now that I'm setting header [/!] [!] but left it in; don't think it should matter [/!][!] hide this if they've entered numcpus and have posted their entries [/!] [hideif [numcpus]>0]
[include file=sitelicenselegal.inc]

Number of workstations:

Number of printers:

[/hideif][!] do these things if they HAVE entered info [/!] [showif [numcpus]>0]

Your site license information:

Cost of fonts: $[costfnts]
Number of CPUs: [numcpus]
Number of printers: [numprt]


[!] calculate charge [/!][!] LOTS of calculations removed here for brevity[/!] [!] basically taking [numcpus] and [numprt] and [costfnts] [/!] [!] and coming up with a CPUsurcharge and a printer surcharge [/!] [!] User is charged whichever is more [/!]

Additional surcharge (printers only): $[totprtsur]
Additional surcharge (CPUs): $[totcpusur][showif [totcpusur]>[totprtsur]][math show=f]finalsur=[totcpusur][/math][/showif] [showif [totprtsur]>[totcpusur]][math show=f]finalsur=[totprtsur][/math][/showif] [showif [totprtsur]=[totcpusur]][math show=f]finalsur=[totprtsur][/math][/showif]

FINAL SURCHARGE: $[finalsur]

[cart]> [/showif]-------- end code ----------- Chris Vargas The whole scene had an eerie, surreal or quality, like when you're on vacation in another city and 'Jeopardy' comes or on at 7 instead of 7:30. http://www.chrisandmaria.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 Chris Vargas

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:

webcat- multiple selection in input field (1997) SSL (1998) Date problems (1997) Encryption method used for [encrypt]? (2000) A question on sub-categories (1997) Error, 101 a DNS problem ? (1997) Banner Ad example (Typhoon) and WebCatalog (1997) Ongoing group search problems ... (1997) 3.05b12 (1999) whole word matching (2004) .html processing? (1998) WebCat2b15MacPlugin - showing [math] (1997) [WebDNA] Webcat install on Windows 2003 Server web edition - NOT AUTHORIZED (2010) HideIf and SKU (2000) Erotic Sites (1997) Emailer (1997) Sorting LISTFILES (1997) Formating found categories (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Emailer setup (1997)