Re[2]: Price Not Appearing [LONG]
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 28505
interpreted = N
texte = Let me step back for a minute and discuss how _I_ understand WebCat to bedesigned to operate. This is more a theoretical discussion than specificexamples of code.WebCat is first and foremost an e-commerce system; as such, it is designed toallow someone to come in and buy something or even several somethings. Theshopping cart is designed to hold information about the user (Name, address,credit card number, etc) as well as what they have selected to purchase ( what,how many of them, how much they cost). Going back to early versions, the fieldsin the shopping cart had fixed names, and those names had to correspond tofields in the catalog.txt database. That was the only way the program knew howto assign values to the shopping cart fields. This was before text/mathvariables and formulas.db.Oddly enough, WebCat uses [SKU], [QUANTITY], and [PRICE] as the most importantfields at the line level. The user wants to buy [QUANTITY] of [SKU] at [PRICE]. All of the other information you needed to display the invoice page had to bestored in the shopping cart/order file. Remember that this was before multipledatabases, too. You had float1-float5, int1-int5, and text1-text10 to chosefrom as fields to store line level information.Then WebCat introduced multiple databases, text and math variables, and theformulas.db database. There had to be some thought given to name precedence,which means if there is a database field with the same name as a text variable,which would be considered the correct one to use. This also came into play withrespect to the shopping cart fields. So the decision was made to do thefollowing (Ken will correct me if I am wrong on the order): cart -> database ->text/math variable. In other words, a field in the cart will override a fieldin any user database, which in turn will override an user-defined math/textvariable. And remember that you can have a [math] and [text] variable with thesame name.This was a most logical way of dealing with the problem; it doesn't break oldcode and yet it is easily understood (or so PCS thought). Without requiringsome complicated naming convention (does [table]![field] look familiar toanyone?), this was the simplest way to deal with variable precedence. And itdoesn't need fixing once you understand how it operates.Today, when an item is added to the shopping cart, [Price] comes from theformulas.db ( and the default formula is to lookup the price from the itemdatabase itself ). This way, you can do whatever magic you want to the price atthe time the item is entered into the shopping cart, at which point THE PRICE ISNOW SET. Sorry for yelling, but some people seem to be missing this clue. Ibelieve that the original poster had changed something so that this step was notfunctioning. There was no price displayed because there was no price in theorderfile. This is to be considered a bug in the user designed template, notWebCat itself.Of course, you can always go back into the cart and change the pricing later, ifthey key a discount coupon (why not ask for that first???). But the normaloperation is that the price as set in the shopping cart has already beenmodified by whatever devious formula the programmer could come up with. If youwant to display something on the shopping cart page, it should come out of theshopping cart file, or be a lookup.All this talk of changing things shows how little people really understand abouthow the software operates. When a template is inside an orderfile context(explicit or implicit), all of the data should be coming from the orderfileitself (apart from a few lookups, if necessary).I hope this long-winded explanation helps someone...John Peacock-------------------------------------------------------------Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server.To end your Mail problems go to
.This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
|
- Re[2]: Price Not Appearing [LONG] (jpeacock@univpress.com 2000)
|
Let me step back for a minute and discuss how _I_ understand WebCat to bedesigned to operate. This is more a theoretical discussion than specificexamples of code.WebCat is first and foremost an e-commerce system; as such, it is designed toallow someone to come in and buy something or even several somethings. Theshopping cart is designed to hold information about the user (Name, address,credit card number, etc) as well as what they have selected to purchase ( what,how many of them, how much they cost). Going back to early versions, the fieldsin the shopping cart had fixed names, and those names had to correspond tofields in the catalog.txt database. That was the only way the program knew howto assign values to the shopping cart fields. This was before text/mathvariables and formulas.db.Oddly enough, WebCat uses [SKU], [QUANTITY], and [PRICE] as the most importantfields at the line level. The user wants to buy [QUANTITY] of [SKU] at [PRICE]. All of the other information you needed to display the invoice page had to bestored in the shopping cart/order file. Remember that this was before multipledatabases, too. You had float1-float5, int1-int5, and text1-text10 to chosefrom as fields to store line level information.Then WebCat introduced multiple databases, text and math variables, and theformulas.db database. There had to be some thought given to name precedence,which means if there is a database field with the same name as a text variable,which would be considered the correct one to use. This also came into play withrespect to the shopping cart fields. So the decision was made to do thefollowing (Ken will correct me if I am wrong on the order): cart -> database ->text/math variable. In other words, a field in the cart will override a fieldin any user database, which in turn will override an user-defined math/textvariable. And remember that you can have a [math] and [text] variable with thesame name.This was a most logical way of dealing with the problem; it doesn't break oldcode and yet it is easily understood (or so PCS thought). Without requiringsome complicated naming convention (does [table]![field] look familiar toanyone?), this was the simplest way to deal with variable precedence. And itdoesn't need fixing once you understand how it operates.Today, when an item is added to the shopping cart, [Price] comes from theformulas.db ( and the default formula is to lookup the price from the itemdatabase itself ). This way, you can do whatever magic you want to the price atthe time the item is entered into the shopping cart, at which point THE PRICE ISNOW SET. Sorry for yelling, but some people seem to be missing this clue. Ibelieve that the original poster had changed something so that this step was notfunctioning. There was no price displayed because there was no price in theorderfile. This is to be considered a bug in the user designed template, notWebCat itself.Of course, you can always go back into the cart and change the pricing later, ifthey key a discount coupon (why not ask for that first???). But the normaloperation is that the price as set in the shopping cart has already beenmodified by whatever devious formula the programmer could come up with. If youwant to display something on the shopping cart page, it should come out of theshopping cart file, or be a lookup.All this talk of changing things shows how little people really understand abouthow the software operates. When a template is inside an orderfile context(explicit or implicit), all of the data should be coming from the orderfileitself (apart from a few lookups, if necessary).I hope this long-winded explanation helps someone...John Peacock-------------------------------------------------------------Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server.To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
jpeacock@univpress.com
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:
docs for WebCatalog2 (1997)
Max Record length restated as maybe bug (1997)
email server and webdna (2006)
WIDGET: random image generator (2007)
Sendmail (1999)
Web Catalog 2 demo (1997)
[urgent] Phone number at SM (2006)
Possible Bug in 2.0b15.acgi (1997)
RE: [WebDNA] WebDNA Showcase? (2008)
Help- Spam Bots are spamming my site. (2007)
verify online (1997)
Bug alert! (1997)
WebCat2b13MacPlugin - [math][date][/math] problem (1997)
Email template names (1997)
default error on NT? (1997)
show all problem (1997)
Communigate+Webcat (2001)
WebCommerce: Folder organization ? (1997)
Changing in a founditems tag (1999)
Storebuilder, Smith-Micro Tech Support (2000)