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 be designed to operate. This is more a theoretical discussion than specific examples of code.WebCat is first and foremost an e-commerce system; as such, it is designed to allow someone to come in and buy something or even several somethings. The shopping 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 fields in the shopping cart had fixed names, and those names had to correspond to fields in the catalog.txt database. That was the only way the program knew how to assign values to the shopping cart fields. This was before text/math variables and formulas.db.Oddly enough, WebCat uses [SKU], [QUANTITY], and [PRICE] as the most important fields 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 be stored in the shopping cart/order file. Remember that this was before multiple databases, too. You had float1-float5, int1-int5, and text1-text10 to chose from as fields to store line level information.Then WebCat introduced multiple databases, text and math variables, and the formulas.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 with respect to the shopping cart fields. So the decision was made to do the following (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 field in any user database, which in turn will override an user-defined math/text variable. And remember that you can have a [math] and [text] variable with the same name.This was a most logical way of dealing with the problem; it doesn't break old code and yet it is easily understood (or so PCS thought). Without requiring some complicated naming convention (does [table]![field] look familiar to anyone?), this was the simplest way to deal with variable precedence. And it doesn't need fixing once you understand how it operates.Today, when an item is added to the shopping cart, [Price] comes from the formulas.db ( and the default formula is to lookup the price from the item database itself ). This way, you can do whatever magic you want to the price at the time the item is entered into the shopping cart, at which point THE PRICE IS NOW SET. Sorry for yelling, but some people seem to be missing this clue. I believe that the original poster had changed something so that this step was not functioning. There was no price displayed because there was no price in the orderfile. This is to be considered a bug in the user designed template, not WebCat itself.Of course, you can always go back into the cart and change the pricing later, if they key a discount coupon (why not ask for that first???). But the normal operation is that the price as set in the shopping cart has already been modified by whatever devious formula the programmer could come up with. If you want to display something on the shopping cart page, it should come out of the shopping cart file, or be a lookup.All this talk of changing things shows how little people really understand about how the software operates. When a template is inside an orderfile context (explicit or implicit), all of the data should be coming from the orderfile itself (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:

    
  1. Re[2]: Price Not Appearing [LONG] (jpeacock@univpress.com 2000)
Let me step back for a minute and discuss how _I_ understand WebCat to be designed to operate. This is more a theoretical discussion than specific examples of code.WebCat is first and foremost an e-commerce system; as such, it is designed to allow someone to come in and buy something or even several somethings. The shopping 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 fields in the shopping cart had fixed names, and those names had to correspond to fields in the catalog.txt database. That was the only way the program knew how to assign values to the shopping cart fields. This was before text/math variables and formulas.db.Oddly enough, WebCat uses [SKU], [QUANTITY], and [PRICE] as the most important fields 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 be stored in the shopping cart/order file. Remember that this was before multiple databases, too. You had float1-float5, int1-int5, and text1-text10 to chose from as fields to store line level information.Then WebCat introduced multiple databases, text and math variables, and the formulas.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 with respect to the shopping cart fields. So the decision was made to do the following (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 field in any user database, which in turn will override an user-defined math/text variable. And remember that you can have a [math] and [text] variable with the same name.This was a most logical way of dealing with the problem; it doesn't break old code and yet it is easily understood (or so PCS thought). Without requiring some complicated naming convention (does [table]![field] look familiar to anyone?), this was the simplest way to deal with variable precedence. And it doesn't need fixing once you understand how it operates.Today, when an item is added to the shopping cart, [Price] comes from the formulas.db ( and the default formula is to lookup the price from the item database itself ). This way, you can do whatever magic you want to the price at the time the item is entered into the shopping cart, at which point THE PRICE IS NOW SET. Sorry for yelling, but some people seem to be missing this clue. I believe that the original poster had changed something so that this step was not functioning. There was no price displayed because there was no price in the orderfile. This is to be considered a bug in the user designed template, not WebCat itself.Of course, you can always go back into the cart and change the pricing later, if they key a discount coupon (why not ask for that first???). But the normal operation is that the price as set in the shopping cart has already been modified by whatever devious formula the programmer could come up with. If you want to display something on the shopping cart page, it should come out of the shopping cart file, or be a lookup.All this talk of changing things shows how little people really understand about how the software operates. When a template is inside an orderfile context (explicit or implicit), all of the data should be coming from the orderfile itself (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)