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:
Database flushing does not work any more... (2000)
WebStar Crashes (2005)
Large database on Mac OS X Server (2000)
Web Developer Product Awards (1997)
Duplicate Carts (2000)
Re:E-Mailer (WebCatb15acgiMac) (1997)
Convert Char (2001)
[WebDNA] Trigger troubles (2014)
how to check for no value while using [URL] to prevent cr (1999)
shipping with weigth (1998)
RE: [WebDNA] anyone use curl with shell? (2010)
Re:2nd WebCatalog2 Feature Request (1996)
Search returns all, not 20 (1997)
[WebDNA] eCommerce in 7.0 but not in 7.1? (2012)
Showif, Hideif reverse logic ? (1997)
Moment of Thanks (1997)
[/application] error? (1997)
WebCommerce: Folder organization ? (1997)
File Uploads... (1997)
[WebDNA] showif with empty variable (2015)