Re: Price Change
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 35583
interpreted = N
texte = There's more than one way to skin a cat using WC. The database approach Isuggested (late at night after a long day) is one, but since your discountsare so simple, you can also just sum the costs of the items in the cart anduse some [showif] [hideif] stuff.Sum the costs of the items BEFORE getting to [subtotal]. Then evaluate thetemporarysubtotal to see if a discount should be given. If so, add anegative number to the cart that will deduct the appropriate amount.Try something along the order of:[showif [temporarysubtotal]>299] [hideif [temporarysubtotal]>499][Discount]=-50[/hideif][/showif][showif [temporarysubtotal]>499] [Discount]=-55[/showif]In the html for the page, add a line that will display whatever discount isgiven or hide it if there isn't one.[showif [Discount]>0]
Discount= | [Discount] |
[/showif]Then continue with the html and WC stuff as if there were no discountincluded. The negative values of [Discount] will be added to the cost ofthe Items ordered and will not foul up WC's built-in use of the [subtotal]and [grandtotal] calcs.
Subtotal= | [subtotal] |
Taxes= | [tax] |
Grandtotal= | [grandtotal] |
etc.Lemme know how it works out.Glenn-------------------------------------------------------------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://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
There's more than one way to skin a cat using WC. The database approach Isuggested (late at night after a long day) is one, but since your discountsare so simple, you can also just sum the costs of the items in the cart anduse some [showif] [hideif] stuff.Sum the costs of the items BEFORE getting to [subtotal]. Then evaluate thetemporarysubtotal to see if a discount should be given. If so, add anegative number to the cart that will deduct the appropriate amount.Try something along the order of:[showif [temporarysubtotal]>299] [hideif [temporarysubtotal]>499][Discount]=-50[/hideif][/showif][showif [temporarysubtotal]>499] [Discount]=-55[/showif]In the html for the page, add a line that will display whatever discount isgiven or hide it if there isn't one.[showif [Discount]>0] Discount= | [Discount] |
[/showif]Then continue with the html and WC stuff as if there were no discountincluded. The negative values of [Discount] will be added to the cost ofthe Items ordered and will not foul up WC's built-in use of the [subtotal]and [grandtotal] calcs.Subtotal= | [subtotal] |
Taxes= | [tax] |
Grandtotal= | [grandtotal] |
etc.Lemme know how it works out.Glenn-------------------------------------------------------------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://search.smithmicro.com/
Glenn Busbin
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:
WebCatalog2 Feature Feedback (1996)
More on the email templates (1997)
Secure server question (1997)
[cart] not being interpreted inside [founditems] (1997)
Email Formatting and Encryption (1998)
I try hard to think positively (1998)
Bug Report, maybe (1997)
(2003)
OT: Time Tracking (2003)
syntax question, not in online refernce (1997)
Quit revisited (1997)
problems with WebCat-Plugin ()
Server problem? (1998)
webcatalog approaching max (1998)
file uploads with webcat...binary? (1998)
form crasehes server (1997)
[Sum] function? (1997)
Problems with [Applescript] (1997)
SHOWIF [var_with_backslash]^[value] (2002)
Data Entry ... Excel Style ... How To? (2001)