Re: webCatalog and Stocks
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 16765
interpreted = N
texte = At 9:13 AM -0800 3/26/98, Giovanna Petrachi is rumored to have typed:> I need Webcatalog alert user who order 10 that I've 5 in stock or that my> stock is empty.> So if an order is OK, webCatalog can proceed to write order in a> ShoppingCart otherwise Webcatalog must alert user and proceed in a> different way.I do something like this:Before the items are displayed on the cart page, I go through a [LINEITEMS]loop to check the ordered quantity against the available inventory. If thecustomer wants more than is available, I readjust their quantity and make anote in htat line item:[LINEITEMS][SHOWIF [QUANTITY]>[LOOKUPdb=MYDB.db&value=[SKU]&lookinfield=SKU&ReturnField=Inventory]][SETLINEITEM CART=[CART]&INDEX=[LINEINDEX]]QUANTITY=[LOOKUPdb=MYDB.db&value=[SKU]&lookinfield=SKU&ReturnField=Inventory]&TEXTA=OVER[/SETLINEITEM][/SHOWIF][/LINEITEMS]Then, when displaying the items later in the page, I say something like:[LINEITEMS][QUANITY][SHOWIF [TEXTA]=OVER](You have requested more than we have instock. Your order had been adjusted.)[/SHOWIF][SETLINEITEM CART=[CART]&INDEX=[LINEINDEX]]TEXTA=[/SETLINEITEM][/LINEITEMS]Now the customer sees how much they can order, and I can erase the notefrom the lineitem.MichaelMichael Winston *By Phone!: (503)/652/8815 x341Internet Coordinator *By e-mail!: michaelw@dhorse.comDark Horse Comics, Inc. *By web!: http://www.dhorse.com/
Associated Messages, from the most recent to the oldest:
At 9:13 AM -0800 3/26/98, Giovanna Petrachi is rumored to have typed:> I need Webcatalog alert user who order 10 that I've 5 in stock or that my> stock is empty.> So if an order is OK, webCatalog can proceed to write order in a> ShoppingCart otherwise Webcatalog must alert user and proceed in a> different way.I do something like this:Before the items are displayed on the cart page, I go through a
[lineitems]loop to check the ordered quantity against the available inventory. If thecustomer wants more than is available, I readjust their quantity and make anote in htat line item:
[lineitems][SHOWIF [QUANTITY]>[LOOKUPdb=MYDB.db&value=[SKU]&lookinfield=SKU&ReturnField=Inventory]][SETLINEITEM CART=
[cart]&INDEX=[LINEINDEX]]QUANTITY=[LOOKUPdb=MYDB.db&value=[SKU]&lookinfield=SKU&ReturnField=Inventory]&TEXTA=OVER[/SETLINEITEM][/SHOWIF][/LINEITEMS]Then, when displaying the items later in the page, I say something like:
[lineitems][QUANITY][SHOWIF [TEXTA]=OVER](You have requested more than we have instock. Your order had been adjusted.)[/SHOWIF][SETLINEITEM CART=
[cart]&INDEX=[LINEINDEX]]TEXTA=[/SETLINEITEM][/LINEITEMS]Now the customer sees how much they can order, and I can erase the notefrom the lineitem.MichaelMichael Winston *By Phone!: (503)/652/8815 x341Internet Coordinator *By e-mail!: michaelw@dhorse.comDark Horse Comics, Inc. *By web!: http://www.dhorse.com/
Michael Winston
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:
Hiding HTML and page breaks (1997)
Plugin or CGI or both (1997)
Sorting (2005)
Multi Actions (1999)
Running _every_ page through WebCat ? (1997)
Need help with emailer- 2 issues (1997)
Problem with updating to 2.1.1 (1998)
Make sure I understand this??? (1997)
RE: Recursion & WebDNA (1999)
variables in template (2000)
[taxRate] [TaxTotal] ? (1997)
RE:It just Does't add up!!! (1997)
Math Hell! (2000)
Support ?? (1997)
Exclude by date - multiple (1997)
Inprovement to listfiles ... (2003)
Error Lob.db records error message not name (1997)
Narrowing NT Crashing error (2000)
Forms Search Questions (1997)
Wanted: More Math Functions (or, Can You Solve This?) (1997)