Trouble with adding multiple items to cart

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 23697
interpreted = N
texte = I seem to be having trouble getting multiple items selected on a product page to be added to a cart. I am trying to use a [formvariable] context to manipulate the items from the previous page, with no luck. If, in the form, I make multiple selections by putting quantities into various fields called quantity, the items are added to that cart in the following fashion. The number of items whose quantities are greater than 0 times the total number of items on the page. For instance, if there are nine items that appear on the product page, and I change the quantity of two of them, I get 18 items added to the cart. If I make a quantity change in all 9 items, I get 81 matches. Here is the code that I have to date:[formvariables name=quantity] [showif [value]>0][addlineitem cart=[cart]&sku=[formvariables name=sku][value][/formvariables]&db=../databases/touchofglass.db]quantity=1[/addlineitem][/showif][/formvariables]What I want to do is this. If someone makes a quantity change in any of the product's quantity field, I want that item to be added to the cart alone. Once I can acheive that, it is my goal to have the quantities of each item appear as a seperate lineitem, so the preferences for it can be changed. In other words, if someone visits the page with nine items on it, and changes the quantity for two products on the page, say item number 19901 & 19902, and sets the quantity of each item to 3, I want a total of 6 lineitems to show up (three for each item). The other items which still have a zero next to them should not be added at all.I hope this makes sense.If anyone can point me in the right direction, I would be appreciative. I have been working on this for about the past 6 hours straight, and have tried many different approaches. This seems like the most promising so far, but I might be far off.Thanks in advance for any help. Associated Messages, from the most recent to the oldest:

    
  1. Re: Trouble with adding multiple items to cart (PCS Technical Support 1999)
  2. Trouble with adding multiple items to cart (Dennis J. Bonsall, Jr. 1999)
I seem to be having trouble getting multiple items selected on a product page to be added to a cart. I am trying to use a [formvariable] context to manipulate the items from the previous page, with no luck. If, in the form, I make multiple selections by putting quantities into various fields called quantity, the items are added to that cart in the following fashion. The number of items whose quantities are greater than 0 times the total number of items on the page. For instance, if there are nine items that appear on the product page, and I change the quantity of two of them, I get 18 items added to the cart. If I make a quantity change in all 9 items, I get 81 matches. Here is the code that I have to date:[formvariables name=quantity] [showif [value]>0][addlineitem cart=[cart]&sku=[formvariables name=sku][value][/formvariables]&db=../databases/touchofglass.db]quantity=1[/addlineitem][/showif][/formvariables]What I want to do is this. If someone makes a quantity change in any of the product's quantity field, I want that item to be added to the cart alone. Once I can acheive that, it is my goal to have the quantities of each item appear as a seperate lineitem, so the preferences for it can be changed. In other words, if someone visits the page with nine items on it, and changes the quantity for two products on the page, say item number 19901 & 19902, and sets the quantity of each item to 3, I want a total of 6 lineitems to show up (three for each item). The other items which still have a zero next to them should not be added at all.I hope this makes sense.If anyone can point me in the right direction, I would be appreciative. I have been working on this for about the past 6 hours straight, and have tried many different approaches. This seems like the most promising so far, but I might be far off.Thanks in advance for any help. Dennis J. Bonsall, Jr.

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:

writing orders to a db (1997) [TaxableTotal] - not working with AOL and IE (1997) searchable list archive (1997) Criticism of WebCatalog: Keep It Coming! (1998) shortening the cart (1998) using showpage and showcart commands (1996) Separate SSL Server (1997) [OT] JS Libraries (2007) Mac v. NT (1998) Triggers Suck! (2000) WCS Newbie question (1997) Virtual Postcards (1998) 2.1b3 --> way slow (1997) WebCatalog for Mac 2.0.1 Released (1997) Secure Sever and showcart errors (1997) FoundItems Question (1998) Which beta for w* 4.1 and a problem w/b12 (1999) Cumulative Shipping charge calculations - your help please. (1997) How to search for fields with 10 or more characters? (2004) Shopping cart now good (fixed it) (1997)