Re: Variable Prices
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 19529
interpreted = N
texte = >I am trying to setup a catalog so that the price is marked up from the>cost with>the markup depending on the cost.>>For example:> if the cost is less the $100.00 then the markup would be 30%> if the cost is between $100.01 and $200.00 then the markup would be 20%> if the cost is between $200.01 and $300.00 then the markup would be 15%> if the cost is over $300.01 then the markup would be 10%>>Can this be done through the formula.db and if so what would the formula be.>Would I need to make any changes to any of my templates?Formulas.db is the right place to do this, and you would not need to changeany templates. The following should get you started:-- Formulas.db --price [math show=f]markup=.1[/math][ShowIf [price]<300][mathshow=f]markup=.15[/math][ShowIf [price]<200][mathshow=f]markup=.2[/math][/ShowIf][/ShowIf][ShowIf [price]<100][mathshow=f]markup=.3[/math][/ShowIf][math][price]*markup[/math]This assumes the markup is 10%, then checks for <300, <200, <100, andresets the markup accordingly, then finally calculates the price based onwhatever the markup landed on.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
Associated Messages, from the most recent to the oldest:
>I am trying to setup a catalog so that the price is marked up from the>cost with>the markup depending on the cost.>>For example:> if the cost is less the $100.00 then the markup would be 30%> if the cost is between $100.01 and $200.00 then the markup would be 20%> if the cost is between $200.01 and $300.00 then the markup would be 15%> if the cost is over $300.01 then the markup would be 10%>>Can this be done through the formula.db and if so what would the formula be.>Would I need to make any changes to any of my templates?
formulas.db is the right place to do this, and you would not need to changeany templates. The following should get you started:--
formulas.db --price [math show=f]markup=.1[/math][ShowIf [price]<300][mathshow=f]markup=.15[/math][ShowIf [price]<200][mathshow=f]markup=.2[/math][/ShowIf][/ShowIf][ShowIf [price]<100][mathshow=f]markup=.3[/math][/ShowIf]
[math][price]*markup[/math]This assumes the markup is 10%, then checks for <300, <200, <100, andresets the markup accordingly, then finally calculates the price based onwhatever the markup landed on.Technical Support | ==== eCommerce and Beyond ====Pacific Coast Software | WebCatalog, WebMerchant,11770 Bernardo Plaza Court | SiteEdit Pro, PhotoMaster,San Diego, CA 92128 | Typhoon619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/
PCS Technical Support
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:
Fun with Dates - finally resolved but.... (1997)
Searching Numbers (2004)
Make sure I understand this??? (1997)
Web Catalog and Net Cloak (1998)
expired beta (1997)
[OT] Read and weep (2003)
using listfiles to build a database? more (2000)
OT: need bad code (2005)
WCS Newbie question (1997)
A quickie question (1997)
Dark Horse Comics success story (1997)
WebCat2: Items xx to xx shown, etc. (1997)
Database changes (1998)
Configuring E-mail (1997)
New public beta available (1997)
SSL (1998)
WebCatalog/WebMerchant Manuals Available (1998)
CC Processing (2001)
There's no belittling going on here ... (2000)
OT Weird Messenger Service message (2002)