Merging LineItems
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 54104
interpreted = N
texte = I need to be able to combine lineitems that have the same SKU/textE and addtheir combined quantities.These lineitems...SKU ITEM QTY TEXTE123 Bear 2 9123 Bear 1 1123 Bear 3 9Should become...SKU ITEM QTY TEXTE123 Bear 5 9123 Bear 1 1I started with the code below, but I'm kinda stuck. It doesn't look like itwill combine the items unless they appear right after one another in the[lineitems] loop.[!]----- Check for same item/same shipping -----[/!][text]dupItem=0[/text][text]theSKU=0[/text][text]theShipTo=0[/text][text]theQuantity=0[/text][orderfile cart=[cart]] [lineitems] [if ("[SKU]"="[theSKU]") & ("[textE]"="[theShipTo]")] [then] [text]dupItem=[lineindex][/text] [text]newQuantity=[math][newQuantity]+[quantity][/math][/text] [/then] [/if] [text]theSKU=[SKU][/text] [text]theShipTo=[textE][/text] [text]theQuantity=[quantity][/text] [/lineitems][/orderfile]---------------------------------------------------------------------Clint DavisWebmaster / Interactive Media SpecialistGray Loon Marketing Group, Inc. http://www.grayloon.com204 Main Street | Evansville, IN 47708 | Phone:812-422-9999----------------------------------------------------------------------------------------------------------------------------------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:
I need to be able to combine lineitems that have the same SKU/textE and addtheir combined quantities.These lineitems...SKU ITEM QTY TEXTE123 Bear 2 9123 Bear 1 1123 Bear 3 9Should become...SKU ITEM QTY TEXTE123 Bear 5 9123 Bear 1 1I started with the code below, but I'm kinda stuck. It doesn't look like itwill combine the items unless they appear right after one another in the[lineitems] loop.[!]----- Check for same item/same shipping -----[/!][text]dupItem=0[/text][text]theSKU=0[/text][text]theShipTo=0[/text][text]theQuantity=0[/text][orderfile cart=[cart]] [lineitems] [if ("[SKU]"="[theSKU]") & ("[textE]"="[theShipTo]")] [then] [text]dupItem=[lineindex][/text] [text]newQuantity=[math][newQuantity]+[quantity][/math][/text] [/then] [/if] [text]theSKU=[SKU][/text] [text]theShipTo=[textE][/text] [text]theQuantity=[quantity][/text] [/lineitems][/orderfile]---------------------------------------------------------------------Clint DavisWebmaster / Interactive Media SpecialistGray Loon Marketing Group, Inc. http://www.grayloon.com204 Main Street | Evansville, IN 47708 | Phone:812-422-9999----------------------------------------------------------------------------------------------------------------------------------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/
Clint Davis
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:
Dates and Math - Simple Subtraction (2004)
more info on [setlineitems] (1997)
Using EIMS instead of Emailer (1998)
using showpage and showcart commands (1996)
email preferences on NT (1997)
Erotic Sites (1997)
Success Stories (1997)
shipcost (1997)
problems with 2 tags (1997)
Adding Fields To Db from DB Helper (1999)
More on the email templates (I like it) (1997)
WC2f3 (1997)
WebDNA Solutions ... sorry! (1997)
Password Generator (2004)
absolute paths for databases? (1997)
PIXO with cometsite ... and/or other plugins (1998)
File Upload (1997)
[taxRate] [TaxTotal] ? (1997)
taxTotal (1997)
Re: (1998)