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. HTH John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 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:

    
  1. Re: Changing SubTotal ( John Peacock 2003)
  2. Re: Changing SubTotal ( Alan White 2003)
  3. Re: Changing SubTotal ( John Peacock 2003)
  4. Re: Changing SubTotal ( Alan White 2003)
  5. Re: Changing SubTotal ( Donovan Brooke 2003)
  6. Re: Changing SubTotal ( Alan White 2003)
  7. Re: Changing SubTotal ( Alan White 2003)
  8. Re: Changing SubTotal ( Alan White 2003)
  9. Re: Changing SubTotal ( John Peacock 2003)
  10. Re: Changing SubTotal ( Donovan Brooke 2003)
  11. Changing SubTotal ( Alan White 2003)
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. HTH John -- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 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)