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:
Problems passing [SKU] with $Replace in 2.0 (1997)
error No such file (2001)
Reverse text string (2002)
WebCat2b12 CGI Mac - [shownext] problem (1997)
Banners and sort of random display (1997)
Hey .. so when are you guys (2004)
docs for WebCatalog2 (1997)
I give up!! (1997)
LOOP and IF statements (1997)
Requiring that certain fields be completed (1997)
Exclamation point (1997)
admin:admin won't work for login:password ! (1999)
Multiple security dbs (1997)
RE: 2nd WebCatalog2 Feature Request (1996)
Problems with SELECT MULTIPLE (1999)
[WebDNA] Need Rosetta to install on OS X? (2010)
Price characteristics? (1997)
Migrating to NT (1997)
Looking for WebCatalog Programmer in Silicon Valley (1998)
Hey .. so when are you guys (2004)