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 change any templates. The following should get you started:-- Formulas.db -- price [math show=f]markup=.1[/math][ShowIf [price]<300][math show=f]markup=.15[/math][ShowIf [price]<200][math show=f]markup=.2[/math][/ShowIf][/ShowIf][ShowIf [price]<100][math show=f]markup=.3[/math][/ShowIf][math][price]*markup[/math]This assumes the markup is 10%, then checks for <300, <200, <100, and resets the markup accordingly, then finally calculates the price based on whatever 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 | Typhoon 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Variable Prices (PCS Technical Support 1998)
  2. Re: Variable Prices (Mark Bergkvist 1998)
  3. Re: Variable Prices (PCS Technical Support 1998)
  4. Re: Variable Prices (Mark Bergkvist 1998)
  5. Re: Variable Prices (PCS Technical Support 1998)
  6. Variable Prices (Mark Bergkvist 1998)
  7. Re: Variable prices and Formulas.db (Grant Hulbert 1997)
  8. Variable prices and Formulas.db (Austin H. Spiegelman 1997)
>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 change any templates. The following should get you started:-- formulas.db -- price [math show=f]markup=.1[/math][ShowIf [price]<300][math show=f]markup=.15[/math][ShowIf [price]<200][math show=f]markup=.2[/math][/ShowIf][/ShowIf][ShowIf [price]<100][math show=f]markup=.3[/math][/ShowIf][math][price]*markup[/math]This assumes the markup is 10%, then checks for <300, <200, <100, and resets the markup accordingly, then finally calculates the price based on whatever 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 | Typhoon 619/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:

ShowNext (1997) using showpage and showcart commands (1996) Range in [showif] (2000) Server Error Question [bug?] (2004) Online docs errata (2000) Exchange rates (2000) Date or time comparisons have bugs ... (1998) 5.0 features (2001) frames & carts (1997) Separate SSL Server (1997) [WebDNA] [append] does not add the newline char at the end of (2009) no global [username] or [password] displayed ... (1997) WebCat editing, SiteGuard & SiteEdit (1997) b12 cannot limit records returned and more. (1997) Prevent multiple appends with Reload Button (1997) Bug Report, maybe (1997) Using Cookie for client specific info? (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) [WebDNA] lighttpd.conf for php and webdna? (2013) (2003)