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 1Something like this should do the trick. It does the consolidation, thendumps the cart contents and adds the lineitems back in with the newquantities.[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][/addlineitem][/listvariables]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 Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
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 1Something like this should do the trick. It does the consolidation, thendumps the cart contents and adds the lineitems back in with the newquantities.[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][/addlineitem][/listvariables]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 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)