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:
using WC to create a DB online (2000)
lineitems not showing when moving up a few versions (2006)
file truncation -- Mac plugin (2000)
[Announce]: Web server security and password protection (1997)
Hiding the URL(was Cart ID Duplication) (2001)
Question about links (1999)
protect acting looney?? (2003)
carriage returns in data (1997)
using listfiles to build a database? more (2000)
Autonumber Work-Around (2003)
upgrading (1997)
Emailer (1997)
Dumb Question about Docs (1997)
NT vs Mac (1997)
flushdatabases (1997)
carriage returns in data (1997)
WebCat2b12 - New features for 1.6 users ... (1997)
XML Parse with XML WebDNA Syntax... (2004)
apparently to problem isolated (1997)
page redirect in webDNA (1997)