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][/addLineIte m] [/showif][!] -- change quantity if there is a dupe [/!] [showif [dupeitem]!0] [setLineItem cart=[cart]&index=[tempdex]&db=product.db]quantity=[nuQuantity][/setLineIte m] [/showif] Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.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:

    
  1. Re: Item in Cart 2 times - Any code? (Rob Marquardt 2000)
  2. Item in Cart 2 times - Any code? (Jesse Proudman 2000)
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][/addLineIte m] [/showif][!] -- change quantity if there is a dupe [/!] [showif [dupeitem]!0] [setLineItem cart=[cart]&index=[tempdex]&db=product.db]quantity=[nuQuantity][/setLineIte m] [/showif] Rob Marquardt Designer/Resident Wirehead Toast Design800 Washington Avenue North Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.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:

Ok here is a question? (1997) Generating Report Totals (1997) RE: Problems with dbcatalog.exe (1997) [WriteFile] problems (1997) WebDNA SpeedTest Update (2006) headers in webcat 4.0. (2000) WebCat2 beta FTP site (1997) Form based Redirect (2001) Webcat/Webmerchant part II (1998) (1997) Problem: 3.0 doesn't update carts (1997) [WebDNA] macOS 10.13.3 and WebDNA Mac Server 8.5.1 - hick-up (2019) Cookie still not working (1999) Summing fields (1997) WebCat2 - Getting to the browser's username/password data (1997) [referrer] tag (1997) Multiple Pulldowns (1997) Error Messages Returned to User (1997) Help formatting search results w/ table (1997) Generating Report Totals (1997)