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:
My slower response (1997)
protect tag on NT IIS (1997)
Find all in search. (2002)
Can you do this??? and other stuff (1997)
Cart Question (1998)
default value from Lookup (was Grant, please help me) (1997)
[search] sort problem (2003)
WCS Newbie question (1997)
Help! WebCat2 bug (1997)
Multiple prices (1997)
Help with Repost Data msg from form (1997)
Snake Bites (1997)
Can I invoke an ssi plugin from within a webcat page (1997)
How to get shownext to just shownext once (1997)
FW: ANother SHOWIF problem (1997)
unable to launch acgi in WebCat (1997)
WebDNA 5 - Function test weirdness or ? (2003)
Code intermittently reverts to previous state (2000)
It just Does't add up!!! (1997)
Authenticating users without dialog box (1997)