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:
Fun with dates (1997)
Re:Searching for ALL / empty form field (1997)
all records returned. (1997)
External Images (1998)
using showpage and showcart commands (1996)
Changes to the List (1997)
Help formatting search results w/ table (1997)
Automatic thumbnail images (1998)
credit card authorization question (1997)
Forms Search Questions (1997)
WebCommerce: Folder organization ? (1997)
Test again - Am I seeing double? (2003)
Textarea Breaks (2000)
Emailer [cart] file names (1997)
Sorting error (1997)
test (2004)
include bug????? (1997)
A question on sub-categories (1997)
WCS Newbie question (1997)
show all problem (1997)