WC2b12: Yes, Formulas.db is for real
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 10396
interpreted = N
texte = >There's actually no formulas.db file, Grant was referring to writing your>own formulas using the built-in [math] functions of WebCat2.0.Sorry, Ken, but there REALLY IS a Formulas.db database that has a very special purpose. Look in your GeneralStore folder and you'll see it there.There is a very special case that goes on 'under the hood' whenever you $Add, $ShowCart, or $Purchase: WebCatalog2 looks for a file called Formulas.db in the same folder as the template, and if it finds a formula that overrides price, unitShipCost, taxRate, or shipCost, then that formula will be used instead of the normal meaning of those 4 variables. This gives you the ability to change prices for different circumstances without allowing visitors to 'hack' prices by typing them in themselves. For instance, you could create a discount for people who have a certain username/password. ClubMac does this for their corporate customers.You can have a different Formulas.db for each of your stores, because WebCatalog always looks in the local folder, so GeneralStore has its own formulas.db and YourStore has separate formulas.db.If you don't have a formula defined for one of the 4 variables listed above, then WebCatalog looks for the corresponding price field in the database that matches the SKU of the product being added (this is how it always worked from WebCat1.0 and up). Same for unitShipCost. taxRate works similarly, but it applies globally to the entire order, not just the one product being added. Same for shipCost.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this talk list send an email tomacjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Associated Messages, from the most recent to the oldest:
>There's actually no
formulas.db file, Grant was referring to writing your>own formulas using the built-in
[math] functions of WebCat2.0.Sorry, Ken, but there REALLY IS a
formulas.db database that has a very special purpose. Look in your GeneralStore folder and you'll see it there.There is a very special case that goes on 'under the hood' whenever you $Add, $ShowCart, or $Purchase: WebCatalog2 looks for a file called
formulas.db in the same folder as the template, and if it finds a formula that overrides price, unitShipCost, taxRate, or shipCost, then that formula will be used instead of the normal meaning of those 4 variables. This gives you the ability to change prices for different circumstances without allowing visitors to 'hack' prices by typing them in themselves. For instance, you could create a discount for people who have a certain username/password. ClubMac does this for their corporate customers.You can have a different
formulas.db for each of your stores, because WebCatalog always looks in the local folder, so GeneralStore has its own
formulas.db and YourStore has separate
formulas.db.If you don't have a formula defined for one of the 4 variables listed above, then WebCatalog looks for the corresponding price field in the database that matches the SKU of the product being added (this is how it always worked from WebCat1.0 and up). Same for unitShipCost. taxRate works similarly, but it applies globally to the entire order, not just the one product being added. Same for shipCost.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this
Talk List send an email tomacjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Grant Hulbert
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:
CommandSecurity? (1997)
Empty Shopping Carts? (1998)
form data submission gets truncated (1997)
4.5 Upgrade (2003)
no global [username] or [password] displayed ... (1997)
Wanted: More Math Functions (or, Can You Solve This?) (1997)
[WebDNA] special chars (2009)
RE: protect tag not working (1998)
webcat (2000)
Download URL & access on the fly ? (1997)
creating a ShipCosts database (1997)
OSX Jaguar (2002)
Which beta for w* 4.1 and a problem w/b12 (1999)
problems with 2 tags shakur (1997)
Progress !! WAS: Trouble with formula.db (1997)
Multiple fields on 1 input (1997)
OK, here goes... (1997)
Sendmail (1999)
Email within tmpl ? (1997)
[WebDNA] [redirect] include a value to pass along? (2010)