Re: Item in Cart 2 times - Any code?
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 28882
interpreted = N
texte = On 3/10/00 4:04 pm, Jesse Proudman so noted...>I need an easy bit of WebCat code to see if an item is already in a cart so>I don't add the same thing twice. Any one?Here's what I use -- if a duplicate item gets added, the quantity selected of the new item gets added to the item already in the cart. This doesn't do anything to update the items price (since I do that later in this case) but could be added to the [setLineItem] with an appropriate price-changing password.The item being added is passed from the form in [skuSelect], the quantity as [quantitySelect][!] -- check for duplicates [/!][math show=f]dupeItem=0,nuQuantity=[quantitySelect][/math][orderfile cart=[cart]][lineitems][showif [sku]=[skuSelect]][math show=f]dupeItem=[quantity][/math][math show=f]nuQuantity=nuQuantity+[quantity][/math][math show=f]tempdex=[lineindex][/math][/showif][/lineitems][/orderfile][!] -- new item if no dupes [/!][showif [dupeItem]=0][addLineItem cart=[cart]&sku=[skuSelect]&db=product.db]quantity=[nuQuantity][/addLineItem][/showif][!] -- change quantity if there is a dupe [/!][showif [dupeitem]!0][setLineItem cart=[cart]&index=[tempdex]&db=product.db]quantity=[nuQuantity][/setLineItem][/showif]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
On 3/10/00 4:04 pm, Jesse Proudman so noted...>I need an easy bit of WebCat code to see if an item is already in a cart so>I don't add the same thing twice. Any one?Here's what I use -- if a duplicate item gets added, the quantity selected of the new item gets added to the item already in the cart. This doesn't do anything to update the items price (since I do that later in this case) but could be added to the [setlineitem] with an appropriate price-changing password.The item being added is passed from the form in [skuSelect], the quantity as [quantitySelect][!] -- check for duplicates [/!][math show=f]dupeItem=0,nuQuantity=[quantitySelect][/math][orderfile cart=[cart]][lineitems][showif [sku]=[skuSelect]][math show=f]dupeItem=[quantity][/math][math show=f]nuQuantity=nuQuantity+[quantity][/math][math show=f]tempdex=[lineindex][/math][/showif][/lineitems][/orderfile][!] -- new item if no dupes [/!][showif [dupeItem]=0][addLineItem cart=[cart]&sku=[skuSelect]&db=product.db]quantity=[nuQuantity][/addLineItem][/showif][!] -- change quantity if there is a dupe [/!][showif [dupeitem]!0][setLineItem cart=[cart]&index=[tempdex]&db=product.db]quantity=[nuQuantity][/setLineItem][/showif]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Rob Marquardt
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:
2.0 Info (1997)
Character limit in [Search]? (1998)
Multiple prices (1997)
Num Sort Descending (2004)
Fwd: Email Problems on 4.0 (2000)
FEATURE REQUEST: Auto Resizing of images (2002)
NT challenges default admin/admin password (2000)
php vs WebCatalog (2000)
[WebDNA] Best practice re: password storage (2013)
Location of Browser Info.txt file (1997)
Code sample - links.tpl (2002)
PIXO support (1997)
quantity limit (1998)
_ in front of field name (1998)
Country & Ship-to address & other fields ? (1997)
Sendmail truncation in Eudora Clients (1998)
Cookie set browser session. (1998)
Multiple fields on 1 input (1997)
RE: Missing contexts on NT (1997)
my price won't move (1997)