[subtotal] problems -- help?

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 16509
interpreted = N
texte = I searched the entire archives of the talk list, and couldn't find a direct answer. We are creating a wholesale site that presents different prices for a user, depending on their account number information. Thus, when they order from us, one user may see a different final price than another user.For example, when we list a price on a page, I am using a lot of [showif] commands to get the right price to show up. This is working really well, except when I get to the shopping cart, and specifically the [subtotal] part. It seems that the [subtotal] can only deal with the quantity*[price], but since my prices aren't in the [price] field of my database, it is not subtotaling properly.I have created a special Formulas.db in the same directory as the ShoppingCart.tmpl file, which looks like this:Name Formula price [lookup db=/greenmarket/catalog.txt&lookInField=sku&value=[sku]&returnField=[showif [SpecialID]^101][price2][/showif][showif [SpecialID]^221][price3][/showif][showif [SpecialID]^334][price4][/showif][showif [SpecialID]^445][price5][/showif]] (that's all on one line for those of you with text wrap on)Basically, every page of the website is properly passing the [SpecialID] variable, and all of the [price#] tags are valid database fields that have data. Right now, the [subtotal] for the shopping cart page shows up as: $0.00 no matter what I do.ANOTHER weird symptom... in order to make sure that the variables were being passed properly to the Formulas.db file, I replaced the price line with this in the Formulas.db file:price [showif [SpecialID]^101]100[/showif]0 The results of this were even more baffling... if I only had one product in the shopping cart, the [subtotal] = $0.00 If I had more than one, the [subtotal] = $1000 I would have expected the result to either be 0.00 or 1000... but not both.Can anyone help me with this problem? I am on a tight deadline and this snafu was not expected!-josh knauer ------------------------ Technical Support Center The EnviroLink Network http://www.envirolink.org/support/Ph: 412-683-6400 Fx: 412-683-8460The EnviroLink Network is membership-supported 501(c)(3) non-profit organization. If you would like to help support our work, please consider becoming a member: http://www.envirolink.org/membership Associated Messages, from the most recent to the oldest:

    
  1. Re: [subtotal] problems -- help? (Technical Support 1998)
  2. Re: [subtotal] problems -- help? (Grant Hulbert 1998)
  3. [subtotal] problems -- help? (Technical Support 1998)
I searched the entire archives of the Talk List, and couldn't find a direct answer. We are creating a wholesale site that presents different prices for a user, depending on their account number information. Thus, when they order from us, one user may see a different final price than another user.For example, when we list a price on a page, I am using a lot of [showif] commands to get the right price to show up. This is working really well, except when I get to the shopping cart, and specifically the [subtotal] part. It seems that the [subtotal] can only deal with the quantity*[price], but since my prices aren't in the [price] field of my database, it is not subtotaling properly.I have created a special formulas.db in the same directory as the ShoppingCart.tmpl file, which looks like this:Name Formula price [lookup db=/greenmarket/catalog.txt&lookInField=sku&value=[sku]&returnField=[showif [SpecialID]^101][price2][/showif][showif [SpecialID]^221][price3][/showif][showif [SpecialID]^334][price4][/showif][showif [SpecialID]^445][price5][/showif]] (that's all on one line for those of you with text wrap on)Basically, every page of the website is properly passing the [SpecialID] variable, and all of the [price#] tags are valid database fields that have data. Right now, the [subtotal] for the shopping cart page shows up as: $0.00 no matter what I do.ANOTHER weird symptom... in order to make sure that the variables were being passed properly to the formulas.db file, I replaced the price line with this in the formulas.db file:price [showif [SpecialID]^101]100[/showif]0 The results of this were even more baffling... if I only had one product in the shopping cart, the [subtotal] = $0.00 If I had more than one, the [subtotal] = $1000 I would have expected the result to either be 0.00 or 1000... but not both.Can anyone help me with this problem? I am on a tight deadline and this snafu was not expected!-josh knauer ------------------------ Technical Support Center The EnviroLink Network http://www.envirolink.org/support/Ph: 412-683-6400 Fx: 412-683-8460The EnviroLink Network is membership-supported 501(c)(3) non-profit organization. If you would like to help support our work, please consider becoming a member: http://www.envirolink.org/membership 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:

MacAuthorize order data fields WAS:How To question... (1997) Emailer and encryption (1997) Copyright ? (1997) Emailer (1997) Change extension (2000) How To question on setting up downloads (1997) Problem 2: Prefs file... (1997) Tech question about web dna actions (1998) SiteEdit Pro, DataBase Helper and Europe (2000) Bug Report, maybe (1997) EXPR text bug? (2000) Root Folder problems cont. (1998) HomePage Caution (1997) Re:HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997) Plugin or CGI or both (1997) WebCatalog NT beta 18 problem (1997) Updated ClipText for Edit Plus 2 (2003) Removing [showif] makes a big difference in speed (1997) WebDNA Writer Needed (1997) no global [username] or [password] displayed ... (1997)