Re: quantity minimum problem

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 12386
interpreted = N
texte = >For instance, if the minim is 50 and person enters 40, in the quantity box, >the number turns to 50 but in the pricing area using the following DNAI think this is more of an HTML sequencing problem than a WebDNA one, although they are related. When you say it turns to 50, where exactly do you mean? Remember you have to tell WebCatalog that the quantity is 50, or else it won't know.I suggest you set up a [SetLineItem] context in your ShoppingCart.tmpl file that tweaks the value of the quantity at the time someone is $Add-ing to the cart.[ShowIf QUANTITYNEEDSCHANGING] [SetLineItem cart=[cart]&index=[NumLineItems]&db=catalog.txt]quantity=NEWQUANTITYVALUE[/SetLineItem] [/ShowIf]And then change your [LineItems] loop to incorporate the newly-changed order file:[OrderFile ShoppingCarts/[cart]] [LineItems] ...your usual line item stuff here [/LineItems] [/OrderFile]Now every time you add something to the cart, its quantity gets changed if necessary just before being displayed.The reason you have to wrap that extra [OrderFile] context around the [LineItems] is a bit technical: if you don't do it then the LineItems would still be in the context of the *old* order file before it had been modified. So by explicitly creating a new OrderFile context, it has a chance to get the new values so the LineItems will show the correct quantity.Sorry for the complexity, but HTML forces us to do things like this because the information you need is always 'lagging' one step behind: the values are stored in the visitor's web browser, and haven't had a chance to get to WebCatalog until after the visitor clicks something. Otherwise it would be a simple matter to just change the quantity in the $Add hyperlink on the previous page, but that's too early in the process.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: quantity minimum problem (Grant Hulbert 1997)
  2. Re: quantity minimum problem (Kevin Furuta 1997)
  3. Re: quantity minimum problem (Grant Hulbert 1997)
  4. Re: quantity minimum problem (Kevin Furuta 1997)
  5. Re: quantity minimum problem (Grant Hulbert 1997)
  6. Re: quantity minimum problem (Kevin Furuta 1997)
  7. Re: quantity minimum problem (Kenneth Grome 1997)
  8. quantity minimum problem (Kevin Furuta 1997)
>For instance, if the minim is 50 and person enters 40, in the quantity box, >the number turns to 50 but in the pricing area using the following DNAI think this is more of an HTML sequencing problem than a WebDNA one, although they are related. When you say it turns to 50, where exactly do you mean? Remember you have to tell WebCatalog that the quantity is 50, or else it won't know.I suggest you set up a [setlineitem] context in your ShoppingCart.tmpl file that tweaks the value of the quantity at the time someone is $Add-ing to the cart.[ShowIf QUANTITYNEEDSCHANGING] [SetLineItem cart=[cart]&index=[NumLineItems]&db=catalog.txt]quantity=NEWQUANTITYVALUE[/SetLineItem] [/ShowIf]And then change your [lineitems] loop to incorporate the newly-changed order file:[OrderFile ShoppingCarts/[cart]] [lineitems] ...your usual line item stuff here [/LineItems] [/OrderFile]Now every time you add something to the cart, its quantity gets changed if necessary just before being displayed.The reason you have to wrap that extra [orderfile] context around the [lineitems] is a bit technical: if you don't do it then the LineItems would still be in the context of the *old* order file before it had been modified. So by explicitly creating a new OrderFile context, it has a chance to get the new values so the LineItems will show the correct quantity.Sorry for the complexity, but HTML forces us to do things like this because the information you need is always 'lagging' one step behind: the values are stored in the visitor's web browser, and haven't had a chance to get to WebCatalog until after the visitor clicks something. Otherwise it would be a simple matter to just change the quantity in the $Add hyperlink on the previous page, but that's too early in the process.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

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:

Shopping problems with 2.1b3 acgi (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) Credit card types (1997) Robert Minor duplicate mail (1997) Email Formatting and Encryption (1998) Upgrading old WebCat Database Files (1997) WebDNA 6 (2004) RE: Upload and WebCat (1998) Extended [ConvertChars] (1997) PROBLEMS WITH PROTECT TAG (2004) linetiems in thankyou.tpl (1997) Q: writefile and uploads. (1998) My slower response (1997) international time (1997) [LOOKUP] (1997) [protect] error page (1997) RE: protect tag on NT (1997) Passing Variable (was How to add product size) (1997) Ampersand (1997) Authenticating users without dialog box (1997)