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:

Re[2]: How true is this? (1999) Removing [showif] makes a big difference in speed (1997) Searching for (field1 OR field2) AND field3 (2000) Uploading Files and Descriptions W* (2000) Change Subtotal (2000) emailer (1998) Re:Merging databases (1997) Prices Dropped (1998) RE: Help name our technology! (1997) Help! WebCat2 bug (1997) How do I send a 404 HTTP header ? (2004) Smith Micro - no competition (2000) db protection on NT (1997) WebDNA 6 and IIS 5.0 HTTP Compression (2004) WebCat b13 CGI -shownext- (1997) Trouble with Netscape (1998) Multiple servers and Webcat (1998) Search-context (1999) Hiding HTML and page breaks (1997) wierd [cart] action! (1997)