Re: [WebDNA] Formulas question

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107805
interpreted = N
texte = Dave Stengel wrote: > I've got a simple Shopping cart that I'm trying to get prices to update > based on the [LineIndex]quantity and my Price Formula. > I've checked my Formula and it updates the price correctly if I add > Quantity=[a number] manually in the URL when its added to cart, but if I > change the quantity on ShoppingCart or Invoice.tpl the price remains > whatever the price was when it was first added to cart. > > Does anyone know a way I can loop though the lineitems and update the > price as the quantity for that lineitem is updated or changed? > > [SetLineItem > cart=[cart]&index=[lineindex]]quantity=[interpret][quantity[lineindex]][/interpret]&textA=[url][lookup > db=db/product.db&lookinfield=sku&value=[url][sku][/url]&returnfield=title][/url][/SetLineItem] Hi Dave, The formulas.db only works when adding a product to the cart. For updating prices, use [setLineitem..] with the 'password' and 'price' params. (price being any calculation you like) http://docs.webdna.us/pages.html?context=SetLineItemContext.html HTH, Donovan -- Donovan Brooke Euca Design Center www.euca.us www.keepitturning.co Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Formulas question (Donovan Brooke 2011)
  2. [WebDNA] Formulas question (Dave Stengel 2011)
Dave Stengel wrote: > I've got a simple Shopping cart that I'm trying to get prices to update > based on the [LineIndex]quantity and my Price Formula. > I've checked my Formula and it updates the price correctly if I add > Quantity=[a number] manually in the URL when its added to cart, but if I > change the quantity on ShoppingCart or Invoice.tpl the price remains > whatever the price was when it was first added to cart. > > Does anyone know a way I can loop though the lineitems and update the > price as the quantity for that lineitem is updated or changed? > > [SetLineItem > cart=[cart]&index=[lineindex]]quantity=[interpret][quantity[lineindex]][/interpret]&textA=[url][lookup > db=db/product.db&lookinfield=sku&value=[url][sku][/url]&returnfield=title][/url][/SetLineItem] Hi Dave, The formulas.db only works when adding a product to the cart. For updating prices, use [setLineitem..] with the 'password' and 'price' params. (price being any calculation you like) http://docs.webdna.us/pages.html?context=SetLineItemContext.html HTH, Donovan -- Donovan Brooke Euca Design Center www.euca.us www.keepitturning.co Donovan Brooke

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:

Search for dates greater than [date] (1997) carriage returns in data (1997) [WriteFile] problems (1997) Uploading Files and Descriptions W* (2000) New Command prefs ... (1997) categories and subcategories (2004) blank page from template (1997) Expires header (1999) Emailer to include Human Name with email Address (2000) Setting a range in a search (1998) Emailer Set Up (1997) WebCat b13 CGI -shownext- (1997) Template transformed itself into a database? (1998) Calendar (1997) WCS Newbie question (1997) request for string functions (1998) Linux -> OS X (2002) I forgot (1998) WC1.6 to WC2 date formatting (1997) WebCat 4.02b5 Mac OSXS [sendmail] bug (2000)