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 productpage to be added to a cart. I am trying to use a [formvariable] contextto manipulate the items from the previous page, with no luck. If, inthe form, I make multiple selections by putting quantities into variousfields called quantity, the items are added to that cart in thefollowing fashion. The number of items whose quantities are greaterthan 0 times the total number of items on the page. For instance, ifthere are nine items that appear on the product page, and I change thequantity of two of them, I get 18 items added to the cart. If I make aquantity change in all 9 items, I get 81 matches. Here is the code thatI have to date:[formvariables name=quantity][showif [value]>0][addlineitem cart=[cart]&sku=[formvariablesname=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 ofthe product's quantity field, I want that item to be added to the cartalone. Once I can acheive that, it is my goal to have the quantities ofeach item appear as a seperate lineitem, so the preferences for it canbe changed. In other words, if someone visits the page with nine itemson it, and changes the quantity for two products on the page, say itemnumber 19901 & 19902, and sets the quantity of each item to 3, I want atotal of 6 lineitems to show up (three for each item). The other itemswhich 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, andhave tried many different approaches. This seems like the mostpromising so far, but I might be far off.Thanks in advance for any help.
Associated Messages, from the most recent to the oldest:
I seem to be having trouble getting multiple items selected on a productpage to be added to a cart. I am trying to use a [formvariable] contextto manipulate the items from the previous page, with no luck. If, inthe form, I make multiple selections by putting quantities into variousfields called quantity, the items are added to that cart in thefollowing fashion. The number of items whose quantities are greaterthan 0 times the total number of items on the page. For instance, ifthere are nine items that appear on the product page, and I change thequantity of two of them, I get 18 items added to the cart. If I make aquantity change in all 9 items, I get 81 matches. Here is the code thatI have to date:[formvariables name=quantity][showif [value]>0][addlineitem cart=
[cart]&sku=[formvariablesname=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 ofthe product's quantity field, I want that item to be added to the cartalone. Once I can acheive that, it is my goal to have the quantities ofeach item appear as a seperate lineitem, so the preferences for it canbe changed. In other words, if someone visits the page with nine itemson it, and changes the quantity for two products on the page, say itemnumber 19901 & 19902, and sets the quantity of each item to 3, I want atotal of 6 lineitems to show up (three for each item). The other itemswhich 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, andhave tried many different approaches. This seems like the mostpromising 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)