HELP..Changing Price after adding to cart.

This WebDNA talk-list message is from

1999


It keeps the original formatting.
numero = 24781
interpreted = N
texte = i havre been banging my head for 14 hrs on this one. and from the look at the archives it has been a tough road for many. Basically i want to have a customer come to the site with a discount code and put the code in to recieve discount pricing. this is the same code for many users.I configured price in the formulas.db to do the discount when the code is correct. I am putting the code number into header3.code is: price [format .[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][showif [header3]=specialcode]0.9*[/showif][lookup db=admin/products.db&lookInField=sku&value=[sku]&returnField=price][/math][/format]taxRate [taxRate]i have two problems in trying to complete this in some user friendly way.one method (preferred) i have them enter the code in a form field on checkout.tpl and post this to invoice.tpl. code is: Please Enter Your Personal Discount Code Below ENTER CODE # ... i already learned that in order for this tpo work i need a lineitems loop at the beginning of the invoice.tpl that reads the line items in the cart and replaces/updates the full price with the discounted price. using the price change password. i am using:[lineitems] [SetLineItem cart=[cart]&index=[lineindex]]password=xxxxx&price=[format .[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][showif [header3]=10452]0.9*[/showif][lookup db=admin/products.db&lookInField=sku&value=[sku]&returnField=price][/math][/format][/SetLineItem][/lineitems]the problem is when the form posts, the header info is added to the cart but the prices do not update using the lineitems loop above.. but if i then reload the page which asks to repost the form and then i repostthe data it updates the items. so basically it all works except i want it to update when the page loads not reloads.any experts out there that can tell me the secret here?ps the other method of having the user enter the code at the beginning has a similar problem. the post on the home page does not get into the cart because though a cart number is created the cart file is not until i go to the next page which is too late.i need to sleep.... jym-- _/_/_/CyberLive, Inc.\_\_\_ _/_/_/_/_/ Jym Duane \_\_\_\_\_\_ Marketing / Custom Design \ E-Commerce Phone: (949) 443-1323 Fax: (949)443-1360 Email: sales@cyberlive.com Web: http://www.cyberlive.com _/_/_/_/_/_/_/_/_/_/_/_/_/_/ \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ _/_/_/_/_/_/_/ The Internet Services Professionals \_\_\_\_\_\_\_ 31781 Camino Capistrano, Suite 302, San Juan Capistrano, CA 92675------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: HELP..Changing Price after adding to cart. (Jym Duane 1999)
  2. Re: HELP..Changing Price after adding to cart. (John Butler 1999)
  3. Re: HELP..Changing Price after adding to cart. (Jym Duane 1999)
  4. Re: HELP..Changing Price after adding to cart. (Nitai 1999)
  5. Re: HELP..Changing Price after adding to cart. (Michael O Shea 1999)
  6. Re: HELP..Changing Price after adding to cart. (Charlie Romero 1999)
  7. HELP..Changing Price after adding to cart. (Jym Duane 1999)
i havre been banging my head for 14 hrs on this one. and from the look at the archives it has been a tough road for many. Basically i want to have a customer come to the site with a discount code and put the code in to recieve discount pricing. this is the same code for many users.I configured price in the formulas.db to do the discount when the code is correct. I am putting the code number into header3.code is: price [format .[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][showif [header3]=specialcode]0.9*[/showif][lookup db=admin/products.db&lookInField=sku&value=[sku]&returnField=price][/math][/format]taxRate [taxRate]i have two problems in trying to complete this in some user friendly way.one method (preferred) i have them enter the code in a form field on checkout.tpl and post this to invoice.tpl. code is: Please Enter Your Personal Discount Code Below ENTER CODE # ... i already learned that in order for this tpo work i need a lineitems loop at the beginning of the invoice.tpl that reads the line items in the cart and replaces/updates the full price with the discounted price. using the price change password. i am using:[lineitems] [SetLineItem cart=[cart]&index=[lineindex]]password=xxxxx&price=[format .[lookup db=admin/prefs.db&lookinfield=pref&value=CURRENCY_ACCURACY&returnfield=value]f][math][showif [header3]=10452]0.9*[/showif][lookup db=admin/products.db&lookInField=sku&value=[sku]&returnField=price][/math][/format][/SetLineItem][/lineitems]the problem is when the form posts, the header info is added to the cart but the prices do not update using the lineitems loop above.. but if i then reload the page which asks to repost the form and then i repostthe data it updates the items. so basically it all works except i want it to update when the page loads not reloads.any experts out there that can tell me the secret here?ps the other method of having the user enter the code at the beginning has a similar problem. the post on the home page does not get into the cart because though a cart number is created the cart file is not until i go to the next page which is too late.i need to sleep.... jym-- _/_/_/CyberLive, Inc.\_\_\_ _/_/_/_/_/ Jym Duane \_\_\_\_\_\_ Marketing / Custom Design \ E-Commerce Phone: (949) 443-1323 Fax: (949)443-1360 Email: sales@cyberlive.com Web: http://www.cyberlive.com _/_/_/_/_/_/_/_/_/_/_/_/_/_/ \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ _/_/_/_/_/_/_/ The Internet Services Professionals \_\_\_\_\_\_\_ 31781 Camino Capistrano, Suite 302, San Juan Capistrano, CA 92675------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Jym Duane

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:

Does anyone have a solution to make carts smaller? (1998) [include ...] behavior (1997) Error log crashes server? (1999) IE Cache Problems... (1999) groupfields, popups, etc. (2000) RE: WebCat: Access denied, but why? - The solution. (1997) Resume Catalog ? (1997) WebCatalog on Mac OSX with iTools (2000) Fwd: Emailer & IMail List Server (1998) Shopping cart problem (2003) View a Order file (1999) NT considerations (1997) ShowNext and random sort (1998) NT - Thanks and Taxes (1997) A Global Variable (1997) blank page from template (1997) F3 crashing server (1997) Moment of Thanks (1997) SIMS setup (1998) [ConvertChars] problem (1997)