Your site license information:
Cost of fonts: $[costfnts]
Number of CPUs: [numcpus]
Number of printers: [numprt]
Additional surcharge (printers only): $[totprtsur]
Additional surcharge (CPUs): $[totcpusur][showif [totcpusur]>[totprtsur]][mathshow=f]finalsur=[totcpusur][/math][/showif][showif [totprtsur]>[totcpusur]][mathshow=f]finalsur=[totprtsur][/math][/showif][showif [totprtsur]=[totcpusur]][mathshow=f]finalsur=[totprtsur][/math][/showif]
FINAL SURCHARGE: $[finalsur][/showif]-------- end code ----------- Chris Vargas The whole scene had an eerie, surreal Your site license information: Cost of fonts: $[costfnts] Additional surcharge (printers only): $[totprtsur] FINAL SURCHARGE: $[finalsur][/showif]-------- end code ----------- Chris Vargas The whole scene had an eerie, surreal DOWNLOAD WEBDNA NOW! 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...
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) ashot today as I could foresee other headaches when passing things viacommand (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 topof invoice. Maybe I didn't bring all of them over the time before, but I didthis time. If I order no software, the redirect works great and the headeris set properly and everything seems to work... nice and transparent to thebuyer.However, now my calculations for the site license don't work. If I order afont, I enter # of workstations and # of printers, then it takes me toinvoice instead of looping back to sitelicense.tpl. It takes me there with acommand 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'llcontinue to look at it as well: I didn't have as much time as I would haveliked 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][getcharsstart=3][name][/getchars]=[url][value][/url]&[/formvariables][/setheader][setheader cart=[cart]]cartIPAddress=[url][ipaddress][/url]&precision=[lookupdb=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=[lookupdb=admin/states.db&lookinfield=ST_ABRV&value=[shiptostate]&returnfield=ST_TAX¬found=0][/setheader][!]Check zip code database last, override if found[/!][search db=admin/zips.db&Z_STARTtype=[lookupdb=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&leZ_STARTdatarq=[url][shiptozip][/url]&Z_ENDtype=[lookupdb=admin/prefs.db&lookinfield=pref&value=ZIPS&returnfield=value]&geZ_ENDdatarq=[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][lookupdb=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][getcharsstart=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 basefont price [/!][showif [GetChars start=1&end=2&from=end][SKU][/GetChars]=FO][mathshow=f]costfnts=[costfnts]+[price][/math][/showif][/lineitems][/orderfile][/showif][!] go to invoice if they have ordered no fonts [/!][showif [costfnts]=0][redirectinvoice.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][/hideif][!] do these things if they HAVE entered info [/!][showif [numcpus]>0]
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 (CPUs): $[totcpusur][showif [totcpusur]>[totprtsur]][mathshow=f]finalsur=[totcpusur][/math][/showif][showif [totprtsur]>[totcpusur]][mathshow=f]finalsur=[totprtsur][/math][/showif][showif [totprtsur]=[totcpusur]][mathshow=f]finalsur=[totprtsur][/math][/showif]
Top Articles:
Talk List
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)