Re: Changing SubTotal
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54047
interpreted = N
texte = Alan White wrote:> I was wondering if someone might be able to give advise on some code I have> done to try and get a discount voucher working.The recommended way to do this is to add a special lineitem containing the discounted amount as a negative price. This has the added advantage that it is trivial to display the discount amount itself on the invoice page without having to recalc it or store it somewhere else (like a header).> > On my billing page I ask the user to add a voucher number of they have one> and then on my invoice page I have used the following code :-> > [!] -- Where HEADER39 is the enteredDiscountNumber -- [/!]> > [text]voucherNo=1234567[/text]> [showif [HEADER39]=[voucherNo]]> [text]discountSubTotal=[math][subTotal]-(([subTotal]/100)*40)[/math][/text]> [setheader cart=[cart]]subTotal=[discountSubTotal][/setlineitem][/setheader]> If you want to do it this way, the docs are pretty clear on how you have to proceed:subTotal - Calculated: based on taxableTotal + nonTaxableTotal. This cannot be overridden directly; if you want to override the subTotal of an order, you must override both taxableTotal and nonTaxableTotal to force the calculation of subTotal to become a new value.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748-------------------------------------------------------------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 Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Alan White wrote:> I was wondering if someone might be able to give advise on some code I have> done to try and get a discount voucher working.The recommended way to do this is to add a special lineitem containing the discounted amount as a negative price. This has the added advantage that it is trivial to display the discount amount itself on the invoice page without having to recalc it or store it somewhere else (like a header).> > On my billing page I ask the user to add a voucher number of they have one> and then on my invoice page I have used the following code :-> > [!] -- Where HEADER39 is the enteredDiscountNumber -- [/!]> > [text]voucherNo=1234567[/text]> [showif [HEADER39]=[voucherNo]]> [text]discountSubTotal=[math][subTotal]-(([subTotal]/100)*40)[/math][/text]> [setheader cart=[cart]]subTotal=[discountSubTotal][/setlineitem][/setheader]> If you want to do it this way, the docs are pretty clear on how you have to proceed:subTotal - Calculated: based on taxableTotal + nonTaxableTotal. This cannot be overridden directly; if you want to override the subTotal of an order, you must override both taxableTotal and nonTaxableTotal to force the calculation of subTotal to become a new value.HTHJohn-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4501 Forbes BoulevardSuite HLanham, MD 20706301-459-3366 x.5010fax 301-429-5748-------------------------------------------------------------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 Web Archive of this list is at: http://webdna.smithmicro.com/
John Peacock
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:
errormessages.db (1997)
FTP FOLDER PERMISSIONS (2004)
Date Sorting (1997)
WebDNA server log analysis scripts (2003)
TABLE (2003)
Error Log (2000)
Authorize.net? (2003)
SSL and reg web* (1997)
WebCat2 several catalogs? (1997)
Date Help! (2003)
Email and name capture (1999)
Stumpted Again (1997)
[OT] Disable/enable field (2003)
Sorting nested search (2003)
emailer (1997)
Review comparison by PC Magazine: Open for On-line Business (1997)
show me your store ! (2003)
webCatalog and Stocks (1998)
spawn (1998)
SetHeader not Working (2006)