Re: Merging LineItems

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54126
interpreted = N
texte = on 11/14/2003 11:17 am, Clint Davis at cdavis@grayloon.com so noted... > I need to be able to combine lineitems that have the same SKU/textE and add > their combined quantities. > > These lineitems... > > SKU ITEM QTY TEXTE > 123 Bear 2 9 > 123 Bear 1 1 > 123 Bear 3 9 > > > Should become... > > SKU ITEM QTY TEXTE > 123 Bear 5 9 > 123 Bear 1 1 Something like this should do the trick. It does the consolidation, then dumps the cart contents and adds the lineitems back in with the new quantities. [orderfile cart=[cart]][!] -- consolidate [/!] [lineitems] [text][sku]-[texte]=[math][text][sku]-[texte][/text]+[quantity][/math][/text ] [/lineitems] [/orderfile] [clearlineitems cart=[cart]][!] -- dump [/!] [listvariables name=-&exact=F][!] -- reload [/!] [listwords words=[name]&delimiters=-] [text]var[index]=[word][/text] [/listwords] [addlineitem cart=[cart]&sku=[var1]&db=mergeLineitems.db]quantity=[value]&textE=[var2][/a ddlineitem] [/listvariables] Rob Marquardt Designer/Resident Wirehead Toast Design 800 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Merging LineItems ( Clint Davis 2003)
  2. Re: Merging LineItems ( Rob Marquardt 2003)
  3. Re: Merging LineItems ( Clint Davis 2003)
  4. Re: Merging LineItems ( Rob Marquardt 2003)
  5. Merging LineItems ( Clint Davis 2003)
on 11/14/2003 11:17 am, Clint Davis at cdavis@grayloon.com so noted... > I need to be able to combine lineitems that have the same SKU/textE and add > their combined quantities. > > These lineitems... > > SKU ITEM QTY TEXTE > 123 Bear 2 9 > 123 Bear 1 1 > 123 Bear 3 9 > > > Should become... > > SKU ITEM QTY TEXTE > 123 Bear 5 9 > 123 Bear 1 1 Something like this should do the trick. It does the consolidation, then dumps the cart contents and adds the lineitems back in with the new quantities. [orderfile cart=[cart]][!] -- consolidate [/!] [lineitems] [text][sku]-[texte]=[math][text][sku]-[texte][/text]+[quantity][/math][/text ] [/lineitems] [/orderfile] [clearlineitems cart=[cart]][!] -- dump [/!] [listvariables name=-&exact=F][!] -- reload [/!] [listwords words=[name]&delimiters=-] [text]var[index]=[word][/text] [/listwords] [addlineitem cart=[cart]&sku=[var1]&db=mergeLineitems.db]quantity=[value]&textE=[var2][/a ddlineitem] [/listvariables] Rob Marquardt Designer/Resident Wirehead Toast Design 800 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 Web Archive of this list is at: http://webdna.smithmicro.com/ 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:

One more time (1997) Upgrade Problem.... (1998) trouble with [shownext] (2000) RAM variables (1997) OK, here goes... (1997) Search in 2 or more catalogs (1997) getchars broken? (1997) [UPPERCASE] (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) Listfiles context (2000) SendTo more emails (1998) carriage returns in data (1997) WebDelivery downloads alias, not original ? (1997) The future of WebCatalog is coming with 4.0... (2000) (1998) WebCatalog for guestbook ? (1997) Thanks for tips, more quest (1997) WebDNA license logging (2003) Execute Applescript (1997) Moment of Thanks (1997)