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:

[OT] Be Nice to Your Computer Wizards (2000) Calculating multiple shipping... (1997) retail integration (2000) IE-caching (1998) moved shoppingCarts folder... now there's nothing in it. (2001) Another date range search Q (2002) converting dates in database (1998) WebCatalog Beta Documentation (1997) Trouble with formula.db (1997) Emailer (1997) contextual shownext (1998) Multiple instances of database (2003) multi-table date sort problem thingy (2002) [WebDNA] Webdna on MAMP (2013) WebDNA Mail issues (2002) NT vs Mac (1997) date and time stamp (2003) Documentation Feedback (1997) Color (2000) cart info (1998)