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:
Date stamp and purging (1998)
WebCat2b13MacPlugIn - syntax to convert date (1997)
using showpage and showcart commands (1996)
Problem with HTML email (2003)
Emailer & IMail List Server (1998)
updating checkbox in a db (1998)
Out of the woodwork (2007)
Site Search Concepts (2003)
A little help on e-mail (HELP!!! :-) ) (1998)
Test (2000)
Mailer Problems (1999)
Individual Tax on Items (1998)
Listfiles (2004)
Web Cat and MS SQL 6.5 (1999)
Can I use a [closedatabase] inside an [exclusivelock]? (2000)
Major Security Hole IIS NT (1998)
GD Scumbucket Spammer (2004)
show me your store ! (2003)
How reliable is WebDNA? (2004)
[OT] Appropriate Signature??? (2003)