Modify instead of Add

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31628
interpreted = N
texte = I'm using the following logic on a shopping cart page.This is my first day with webcatalog so bear with me :)[showif [action]=Add] [addlineitem db=wiring.db&cart=[cart]&sku=[url][sku][/url]]quantity=1[/addlineitem] [/showif][showif [action]=Remove] [removelineitem db=wiring.db&cart=[cart]&index=[index]] [/showif][showif [action]=quantity] [SetLineItem db=wiring.db&cart=[cart]&index=[index]]quantity=[new_quant][/SetLineItem] [/ShowIf] The quantity logic basically works by re-calling the cart.tpl with a modified (user entered) quantity.But... what if I add an item, go back to browsing my catalog, browse to an identical item in my catalog, and click the add button again. Yes, I do want to buy a 2nd whatever, but didn't know it the first time I hit the cart page.Now when I go to my cart I have two identical line items for the same product. Does anyone have a set of tags (or the logic for), reading through a cart, checking to see if two sku's match, adding the quantities together, and processing it as a setlineitem instead of an addlineitem?thanks,-David-- David B. Gersh - RHCE Director of Web Services dbg@clarityconnect.com ________________________________________________________ All non-web related questions to help@clarityconnect.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: Modify instead of Add (David Gersh 2000)
  2. Modify instead of Add (David Gersh 2000)
  3. Re: Modify instead of Add (Michael O Shea 2000)
I'm using the following logic on a shopping cart page.This is my first day with webcatalog so bear with me :)[showif [action]=Add] [addlineitem db=wiring.db&cart=[cart]&sku=[url][sku][/url]]quantity=1[/addlineitem] [/showif][showif [action]=Remove] [removelineitem db=wiring.db&cart=[cart]&index=[index]] [/showif][showif [action]=quantity] [SetLineItem db=wiring.db&cart=[cart]&index=[index]]quantity=[new_quant][/SetLineItem] [/ShowIf] The quantity logic basically works by re-calling the cart.tpl with a modified (user entered) quantity.But... what if I add an item, go back to browsing my catalog, browse to an identical item in my catalog, and click the add button again. Yes, I do want to buy a 2nd whatever, but didn't know it the first time I hit the cart page.Now when I go to my cart I have two identical line items for the same product. Does anyone have a set of tags (or the logic for), reading through a cart, checking to see if two sku's match, adding the quantities together, and processing it as a setlineitem instead of an addlineitem?thanks,-David-- David B. Gersh - RHCE Director of Web Services dbg@clarityconnect.com ________________________________________________________ All non-web related questions to help@clarityconnect.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 David Gersh

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:

How To question on setting up downloads (1997) Associative lookup style? + bit more (1997) Sku numbers (1997) Nested vs conditional (1997) Reload adding to cart (2001) # fields limited? (1997) WebCat B13 Mac CGI -- Frames question (1997) Proper way to save links in a db (2002) Help! WebCat2 bug (1997) Quit revisited (1997) Nested [xxx] contexts & Bad Suffix (1998) WebCatalog.acgi quitting with error Type 2 (1998) f2 download problems (1997) WC Database Format (1997) [OT] 'Email this story to a friend' (2003) WebCat 4 crashes WebStar / Shownext Links (2001) FYI: virus alert (1996) Missing from Docs [folderName] (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Shell script within a sandbox (2005)