numero = 10531
interpreted = N
texte = >I need to know how to get a total number of items ordered to calculate>shipping costs. I found the [numLineItems] command but that appears to>only get the number of separate items ordered, not the overall total. >Am I missing something in the docs?Good point. We should probably pre-calculate that for you. But in the meantime you can use a [math] context to calculate it yourself.[math]totalItems=[lineItems][quantity]+[/lineItems]0[/math]which looks like totalItems=1+3+1+1+3+0 to WebDNA (the last 0 is to prevent a dangling + in the equation)Then somewhere in your purchase form you can put something likeThere is another way to do this with Formulas.db, but I'll leave that as an exercise to the reader.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this talk list send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Associated Messages, from the most recent to the oldest:
Re: Getting total number of items ordered (Grant Hulbert 1997)
>I need to know how to get a total number of items ordered to calculate>shipping costs. I found the [numLineItems] command but that appears to>only get the number of separate items ordered, not the overall total. >Am I missing something in the docs?Good point. We should probably pre-calculate that for you. But in the meantime you can use a [math] context to calculate it yourself.[math]totalItems=[lineitems][quantity]+[/lineItems]0[/math]which looks like totalItems=1+3+1+1+3+0 to WebDNA (the last 0 is to prevent a dangling + in the equation)Then somewhere in your purchase form you can put something like[math]totalItems*1.95[/math]>There is another way to do this with formulas.db, but I'll leave that as an exercise to the reader.Grant Hulbert, V.P. Engineering | Tools for WebWarriorsPacific Coast Software | WebCatalog, WebCommerce Solution11770 Bernardo Plaza Court, #462 | SiteEdit, SiteCheck, PhotoMasterSan Diego, CA 92128 |619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com------------------------------------To leave this Talk List send an email to macjordomo@smithmicro.comwith BODYunsubscribe WebDNA-Talk------------------------------------
Grant Hulbert
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...