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:
Checkboxes (1997)
Bug at start of Apache 2 with iTools 7 (2003)
bcc and sendmail (2001)
Question about replacing words (1998)
shownext not showing next...still r2 (1997)
Help! WebCat2 bug (1997)
TeaRoom (1997)
Moving Files (2000)
autosensing lanague selection (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Tab Charactor (1997)
Opinion Poll Please (2002)
Multiple Replaces? (1997)
Mac v. NT (1998)
Webstar 1.3.1 PPC (1997)
form data submission gets truncated (1997)
Secure Web Server (1999)
Summing a field full of numbers ... (1997)
carriage returns in data (1997)
HTTP upload (2000)