Re: How can I record purchases to a database?
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 17830
interpreted = N
texte = Thanks for the reply.>The cart number is always available everywhere on a page in which you pass>the cart in the URL. There is no need to do any special contexts or pass>anything in with math. It's just there with [cart], just as if you passed>in fred=1234, and [fred] would be available anywhere on the page.I understand what you are telling me. I AM passing the [cart] in the URL. As I explain below, it is showing up fine elsewhere on the page.If what you say is correct, then I would expect that the following WebDNA would work. [lineitems][append db=NMI_Purchases.db]thisCart=[cart]&lineNum=[lineIndex]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price]&Extension=[format .2f][math][quantity]*[price][/math][/format][/append][/lineItems]This is the second sequence of contexts I tried that successfully looped through the line items and wrote each line's content to a separate record in my purchases.db database. That's most of what I want. It looks like this:thisCart lineNum Qty SKU ProdName Price Extension 1 3 BN-1218 Red Nylon 13.00 39.00 2 2 BN-1218P Red Nylon w/pocket 14.00 28.00On the page containing the WebDNA listed above, the appropriate cart number shows up everywhere but inside the [lineItems] context. As you can see, however, the cart number is not being written to the database.I am assuming that it is clear that I must use the expression thisCart=[cart] in order to assign the cart value to each record in the database. The value must be assigned to a field.If the [cart] value shuld appear anywhere i use it on the page as long as it has been passed to the page in the URL, please tell me what I have done incorrectly.Please be confident that I am not trying to make things difficult or cast WebCatalog or PCS in a bad light. I LOVE working with both. I respect the work you have done, particularly in the latest version. I plan on selling copies of it or stores on my own site to lots of customers. I'm sure I have just overlooked something somewhere. I've been looking at it for so long now, I'm probably overlooking the obvious. Any help would be appreciated . . . even if it's the news that I can't do what I want to do. If that's the case, I'll try something else.ThanksJerryJerry N. Nielsen Voice: (626)351-0201comm$TRUCT Associates Fax: (626)351-0033Managing Consultant Cellular: (818)257-29373835 Landfair RoadPasadena, CA 91107We con$TRUCT commerce sites that work the way YOU want them to!Thought for the day: The longest distance between to points is a shortcut.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Associated Messages, from the most recent to the oldest:
Thanks for the reply.>The cart number is always available everywhere on a page in which you pass>the cart in the URL. There is no need to do any special contexts or pass>anything in with math. It's just there with
[cart], just as if you passed>in fred=1234, and [fred] would be available anywhere on the page.I understand what you are telling me. I AM passing the
[cart] in the URL. As I explain below, it is showing up fine elsewhere on the page.If what you say is correct, then I would expect that the following WebDNA would work.
[lineitems][append db=NMI_Purchases.db]thisCart=
[cart]&lineNum=[lineIndex]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price]&Extension=[format .2f]
[math][quantity]*[price][/math][/format][/append][/lineItems]This is the second sequence of contexts I tried that successfully looped through the line items and wrote each line's content to a separate record in my purchases.db database. That's most of what I want. It looks like this:thisCart lineNum Qty SKU ProdName Price Extension 1 3 BN-1218 Red Nylon 13.00 39.00 2 2 BN-1218P Red Nylon w/pocket 14.00 28.00On the page containing the WebDNA listed above, the appropriate cart number shows up everywhere but inside the
[lineitems] context. As you can see, however, the cart number is not being written to the database.I am assuming that it is clear that I must use the expression thisCart=
[cart] in order to assign the cart value to each record in the database. The value must be assigned to a field.If the
[cart] value shuld appear anywhere i use it on the page as long as it has been passed to the page in the URL, please tell me what I have done incorrectly.Please be confident that I am not trying to make things difficult or cast WebCatalog or PCS in a bad light. I LOVE working with both. I respect the work you have done, particularly in the latest version. I plan on selling copies of it or stores on my own site to lots of customers. I'm sure I have just overlooked something somewhere. I've been looking at it for so long now, I'm probably overlooking the obvious. Any help would be appreciated . . . even if it's the news that I can't do what I want to do. If that's the case, I'll try something else.ThanksJerryJerry N. Nielsen Voice: (626)351-0201comm$TRUCT Associates Fax: (626)351-0033Managing Consultant Cellular: (818)257-29373835 Landfair RoadPasadena, CA 91107We con$TRUCT commerce sites that work the way YOU want them to!Thought for the day: The longest distance between to points is a shortcut.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jerry Nielsen
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:
using showpage and showcart commands (1996)
A multi-processor savvy WebCatalog? (1997)
Rounding question (2002)
Plugin or CGI or both (1997)
Searching a field and returning the highest value (1997)
convertchars and case? (1998)
[WebDNA] Send Mail and SMTP Host (2015)
So many lookers, hey smith micro (2003)
Size of a folder? (2003)
Using Plug-In while running 1.6.1 (1997)
HELP WITH DATES (1997)
[WebDNA] A new commerce system for v7+ (2011)
Search for starts with and ends with? (2003)
WebCatalog for guestbook ? (1997)
New WebDNA patches available on the DRC (2004)
2nd try: possible to weight results of grouped fieldssearch? (1998)
2nd WebCatalog2 Feature Request (1996)
[WebDNA] Difference in time calculations (2017)
Lookup & Form Variables (2000)
multi-paragraph fields (1997)