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:

Shopping Cart Best Practices (2006) Practice runs ? (1997) calculating tax rates, mail order solutions and version 2 (1997) Help! WebCat2 bug (1997) Excluding orders from WebMerchant processing (1998) GuestBook example (1997) Resume Catalog ? (1997) RE: Answer: WebDelivery downloads alias, not original ? (1997) Closing db's & caching templates (was: Shippingcalculations) (1997) Which GUI HTML editors work with WC ? (1997) multipart part 2 (2004) Webcat/Webmerchant part II (1998) Database Program (1997) [regexp] will be renamed to [grep] in next release (2000) Date problems-more (1997) WebCat2: Items xx to xx shown, etc. (1997) Extended [ConvertChars] (1997) WebCatalog for Postcards ? (1997) Dummy Credit Card Number for debug? (1997) search problem (2002)