Re: Passing [quantity]

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 35002
interpreted = N
texte = Frankly, I'm mystified as to what you are doing, or even why. If you have your system set up properly, the user can change the quantity when- ever they like and your price gets changed appropriately.I'm guessing that you have some sort of volume discount and you are concerned that a smart user will order 1000 then go back and change it to 1, yet still get the 1000-unit price.Create a loop at the top of your invoice page, after they have the chance to change the quantity but before they complete the purchase. Use a [lineitems] loop and reset the price based on the quantity in the cart at that time. This way, even if they go back to the shopping_cart page and adjust the quantity, you will always have a chance to correct the price.You can also do the price update at the same time they perform change the quantity. Remember that when changing the price, you need to use a price-change password. It is not a security issue because it is a context rather than a command (the user never can see the password).John PeacockGlenn Busbin wrote: > > I'm having a problem passing a [quantity] field to Invoice.tpl. It passes > from the Results.tpl to the ShoppingCart.tpl, but when I go to Invoice.tpl, > it's replaced by an 8-digit number. > > This is true for all items added to a cart and each gets the same 8-digit > number in the [quantity] field of Invoice.tpl. Each cart gets a different > 8-digit number and each item in a cart has [quantity] replaced. When the > totals are determined on the Invoice.tpl, the 8-digit number in [quantity] > makes for some major league orders. > > If I go back to ShoppingCart.tpl from Invoice.tpl, the 8-digit number then > replaces [quantity] there, too. > > Here's the code from each page: > > Results.tpl > ----------------------------------------------------- >
> > > > > > >
> > ShoppingCart.tpl > ----------------------------------------------------- >
> > > (snip) > > SIZE=-1>[quantity] > > (Note: If I use the following, I don't get the 8-digit replacement, but it > allows users to enter a different value for [quantity. That's not what I'd > like them to do here, because [price] is calculated according to the > quantity ordered and they can cheat the system here.) > > > > Invoice.tpl > ----------------------------------------------------- > [SetHeader > cart=[cart]]shipVia=[url][__shipVia][/url]&State=[url][__State][/url]&CartIPAddr > ess=[ipAddress][/SetHeader] > > [lineitems] > [SetLineItem > cart=[cart]&index=[lineindex]]quantity=[interpret][quantity[lineindex]][/interpr > et]&textA=[url][lookup > db=POL.db&lookinfield=sku&value=[url][sku][/url]&returnfield=Name][/url][/SetLin > eItem] > [/lineitems] > > > > (snip) > > [lineItems] > > [lineIndex] > [sku]  > [textA] > [quantity] > $[price] > $[format > .2f][math][quantity]*[price][/math][/format] > > [/lineItems] > > ------------------------------------------------------------- > 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 > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Passing [quantity] (Glenn Busbin 2000)
  2. Re: Passing [quantity] (Glenn Busbin 2000)
  3. Re: Passing [quantity] (John Peacock 2000)
  4. Passing [quantity] (Glenn Busbin 2000)
  5. Passing [quantity] (Glenn Busbin 2000)
Frankly, I'm mystified as to what you are doing, or even why. If you have your system set up properly, the user can change the quantity when- ever they like and your price gets changed appropriately.I'm guessing that you have some sort of volume discount and you are concerned that a smart user will order 1000 then go back and change it to 1, yet still get the 1000-unit price.Create a loop at the top of your invoice page, after they have the chance to change the quantity but before they complete the purchase. Use a [lineitems] loop and reset the price based on the quantity in the cart at that time. This way, even if they go back to the shopping_cart page and adjust the quantity, you will always have a chance to correct the price.You can also do the price update at the same time they perform change the quantity. Remember that when changing the price, you need to use a price-change password. It is not a security issue because it is a context rather than a command (the user never can see the password).John PeacockGlenn Busbin wrote: > > I'm having a problem passing a [quantity] field to Invoice.tpl. It passes > from the Results.tpl to the ShoppingCart.tpl, but when I go to Invoice.tpl, > it's replaced by an 8-digit number. > > This is true for all items added to a cart and each gets the same 8-digit > number in the [quantity] field of Invoice.tpl. Each cart gets a different > 8-digit number and each item in a cart has [quantity] replaced. When the > totals are determined on the Invoice.tpl, the 8-digit number in [quantity] > makes for some major league orders. > > If I go back to ShoppingCart.tpl from Invoice.tpl, the 8-digit number then > replaces [quantity] there, too. > > Here's the code from each page: > > Results.tpl > ----------------------------------------------------- > > > > > [cart]> > > > > > ShoppingCart.tpl > ----------------------------------------------------- >
> [cart]> > > (snip) > > SIZE=-1>[quantity] > > (Note: If I use the following, I don't get the 8-digit replacement, but it > allows users to enter a different value for [quantity. That's not what I'd > like them to do here, because [price] is calculated according to the > quantity ordered and they can cheat the system here.) > > > > Invoice.tpl > ----------------------------------------------------- > [SetHeader > cart=[cart]]shipVia=[url][__shipVia][/url]&State=[url][__State][/url]&CartIPAddr > ess=[ipaddress][/SetHeader] > > [lineitems] > [SetLineItem > cart=[cart]&index=[lineindex]]quantity=[interpret][quantity[lineindex]][/interpr > et]&textA=[url][lookup > db=POL.db&lookinfield=sku&value=[url][sku][/url]&returnfield=Name][/url][/SetLin > eItem] > [/lineitems] > > [cart]> > > (snip) > > [lineitems] > > [lineIndex] > [sku]  > [textA] > [quantity] > $[price] > $[format > .2f][math][quantity]*[price][/math][/format] > > [/lineItems] > > ------------------------------------------------------------- > 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 > Web Archive of this list is at: http://search.smithmicro.com/------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ John Peacock

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:

WebCatalog 2.0 b 15 mac (1997) [TaxableTotal] - not working with AOL and IE (1997) So many lookers, hey smith micro (2003) Embedded [Search] Context Snippets (Very Useful) (1998) WC2.0 Memory Requirements (1997) [LOOKUP] (1997) wish list (2002) Pithy questions on webcommerce & siteedit (1997) RE: How to verify email address (1997) Editing Users.db (1997) [WebDNA] AC paymethod is missing (2008) OH CRAP!!!!!- Template not found error!!! (1999) listfiles, moving files (1998) multi-paragraph fields (1997) case number with spaces. (2000) Bad Cookie / Internet Option / Internet Explorer (2004) Error 11 (1996) assigning a id no. (2000) Authorize.net (2003) redirect & arguments (2001)