re: How can I record purchases to a database?

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17783
interpreted = N
texte = Hi all,Earlier I wrote =================== I'm trying to record the purchases customers make to a database to be recalled later to check on the status of an order. I've tried a number of different things, btu the only syntax I have come up with that does anything is what I have listed below.It is part of my Thank_you.tpl template.All the other parts of my site work fine. Line items from the shopping cart are displayed properly in the invoice template and also in the thank you template.My WebDNA looks like this:[append db=NMI_Purchases.db] [lineitems] CartNum=[cart]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price] &Extension=[format .2f][quantity]*[Price][/format] [/lineItems] [/append]This code appends the record to my database, Purchase.db as you see below. The CartNum field name followed by the = sign is placed at the end of the record instead of the beginningCartNum Qty SKU ProdName Price Extension 3 BN-1218 Red Nylon 13.00 39.00 CartNum=297837539369=====================================================================After thinking about it for a while, I realized that I wasn't getting the WebDNA to loop through the line items because I had the [append] and [lineItems] contects in the wrong order. So I changed them to the following:[lineitems] [append db=NMI_Purchases.db] CartNum=[cart]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price] &Extension=[format .2f][quantityPrice][/format] [/append] [/lineItems]This returns close to what I want in the database - as follows:CartNum Qty SKU ProdName Price Extension 3 BN-1218 Red Nylon 13.00 39.00 4 BN-1218P Red Nylon w/pocket 14.00 56.00As you can see, I am getting everything but the [cart] number. I'm assuming that this is because the cart number is not part of the line items in the cart. (Makes sense.)Now my question is - How do I get the cart number to be included in the record that is written to the database?Thanks for any help.Jerry Nielsen - commSTRUCT Associates Jerry N. Nielsen Voice: (626)351-0201 comm$TRUCT Associates Fax: (626)351-0033 Managing Consultant Cellular: (818)257-2937 3835 Landfair Road Pasadena, 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:

    
  1. Re: How can I record purchases to a database? (Jerry Nielsen 1998)
  2. Re: How can I record purchases to a database? (PCS Technical Support 1998)
  3. Re: How can I record purchases to a database? (Jerry Nielsen 1998)
  4. Re: How can I record purchases to a database? (PCS Technical Support 1998)
  5. Re: How can I record purchases to a database? (Jerry Nielsen 1998)
  6. Re: How can I record purchases to a database? (Chris Gursche 1998)
  7. Re: How can I record purchases to a database? (Sandra L. Pitner 1998)
  8. Re: How can I record purchases to a database? (Jerry Nielsen 1998)
  9. re: How can I record purchases to a database? (Kenneth Grome 1998)
  10. re: How can I record purchases to a database? (Jerry Nielsen 1998)
Hi all,Earlier I wrote =================== I'm trying to record the purchases customers make to a database to be recalled later to check on the status of an order. I've tried a number of different things, btu the only syntax I have come up with that does anything is what I have listed below.It is part of my Thank_you.tpl template.All the other parts of my site work fine. Line items from the shopping cart are displayed properly in the invoice template and also in the thank you template.My WebDNA looks like this:[append db=NMI_Purchases.db] [lineitems] CartNum=[cart]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price] &Extension=[format .2f][quantity]*[Price][/format] [/lineItems] [/append]This code appends the record to my database, Purchase.db as you see below. The CartNum field name followed by the = sign is placed at the end of the record instead of the beginningCartNum Qty SKU ProdName Price Extension 3 BN-1218 Red Nylon 13.00 39.00 CartNum=297837539369=====================================================================After thinking about it for a while, I realized that I wasn't getting the WebDNA to loop through the line items because I had the [append] and [lineitems] contects in the wrong order. So I changed them to the following:[lineitems] [append db=NMI_Purchases.db] CartNum=[cart]&Qty=[quantity]&SKU=[SKU]&ProdName=[ProdName]&Price=[price] &Extension=[format .2f][quantityPrice][/format] [/append] [/lineItems]This returns close to what I want in the database - as follows:CartNum Qty SKU ProdName Price Extension 3 BN-1218 Red Nylon 13.00 39.00 4 BN-1218P Red Nylon w/pocket 14.00 56.00As you can see, I am getting everything but the [cart] number. I'm assuming that this is because the cart number is not part of the line items in the cart. (Makes sense.)Now my question is - How do I get the cart number to be included in the record that is written to the database?Thanks for any help.Jerry Nielsen - commSTRUCT Associates Jerry N. Nielsen Voice: (626)351-0201 comm$TRUCT Associates Fax: (626)351-0033 Managing Consultant Cellular: (818)257-2937 3835 Landfair Road Pasadena, 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:

RE:DatabaseHelper (1997) MySQL UPDATE (2007) UPS charges (2000) [WebDNA] [sendmail] mystery (2009) Shared conversion under WebTen (1998) Logging purchases (1997) Confirming a bug/oddity (2003) Re:Remote stockroom ? (1998) security (1997) Sorting error (1997) Num Sort Descending (2004) date format (another question) (2000) Some Questions (1997) access denied problem (1997) Adding freight and percentages (2000) [spawn] and [formvariables] (1999) japanese characters (1997) RE: Netscape v. IE (1997) WebCat2b13MacPlugIn - [include] (1997) need to add a sku field to an existing db (2005)