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.htmlHTH,Donovan-- Donovan BrookeEuca Design Centerwww.euca.uswww.keepitturning.co
Associated Messages, from the most recent to the oldest:
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.htmlHTH,Donovan-- Donovan BrookeEuca Design Centerwww.euca.uswww.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:
Three new problems ... (1997)
Encrypt/Decrypt (2007)
Webcat2, WebCommerce, Mod 10 etc. (1997)
Documentation Feedback (1997)
emailer (1997)
[WebDNA] Issue with variable inside a Function (2018)
Best way to download a db (2003)
[Fwd: F3 database munching] (1997)
[WebDNA] DNA suffix (2008)
Decimal/Modulus (2001)
Problems passing [SKU] with $Replace in 2.0 (1997)
japanese characters (1997)
More than one db with the same namn (was: WC2f3) (1997)
2.0 Info (1997)
WebCat2b13MacPlugIn - [showif][search][/showif] (1997)
RE: WebCatalog2 for NT Beta Request (1997)
Trouble with formula.db (1997)
Help! Error: Help! I'm stuck: Can't open order file. Ignoring [OrderFile] context (2000)
WebCat2: Items xx to xx shown, etc. (1997)
Here is the code: (2000)