Re: orderfile headers (was: 2nd Request for help/advice onvariable pricing)
This WebDNA talk-list message is from
2000
It keeps the original formatting.
numero = 34948
interpreted = N
texte = If you are associating a cart# with each user session anyway - then all you need to dois be within an ordefile context (you can wrap a whole page with one) and then theorderfile's headers (the orderfile with the same # as the cart # the user is luggingaround) are available with a simple [headerN] (1-40), or else one of the predefinedones like [city]).(http://betadoc.smithmicro.com/OrderFileFormat.html)If you are on a page where the user got there at the same time you had him use a webcatshopping command (like add, showcart, purchase, remove,...) then you don't even have tobother with the explicit orderfile context - because you are already within an implicitone.So say the user comes to a form for the first time and one of the inputs is this-and say at that moment 'header14' has not yet been given a value in that orderfile. Sothen the HTML that is returned to the browser is- (since in orderfile contexts undefinedheaders act like variables assigned to the null string - same behavior as db fieldswith no value.)Which means the user sees an input with no predefined value. Perfect since this is his1st visit.Now say he fills in the form and submits it so now he is on the next page where you doerror checking. He goofed up something so you instruct him to go back and check hisform values and submit the form again after he corrects his errors. He uses a linkwhich goes back to that page where the form is, and now the HTML that is returned tohis browser is-(if he had input yes for the 'whatever' text input-)See? The orderfile is essentially 2 databases (one for the header data and one for thelineitems) which webcat engineers have made extremely accessible to make your hassle aslittle as possible. You could write an ecommerce site with out every using a webcatorderfile - using all your own custom dbs etc... but why bother? Then everytime youwanted [whatever14] you would have to do this-[Searchdb=custom.db&eqKEYFIELDdatarq=[value]&max=1][FoundItems][whatever14][/FoundItems][/Search]Plus to get it in there in the first place you would have to use a [append] or[replace]... this is all done for you with webcat orderfiles.-JohnSteven Jarvis wrote:> John,>> I have some questions about something you said earlier, regarding orderfile> headers:>> >>> seems easier to me stick all the field values in orderfile headers so you> >>> can simply use imputs with predefined values equal to those headers.> >>> >> I'm not exactly sure what you mean by using inputs with predefined values.> >> Do you mean the input name equals a particular header?> >> > which will evaluate to-> > > > when Header14 has no value yet, but-> > > > when Header14 has a value of yes already>> What's the advantage of using orderfile headers over a separate database? I> guess I just don't see how using the headers would work for my application> here, especially after re-reading the Tea Room tutorial again. I'm sure that> the headers can be used to do all sorts of cool stuff, I just don't> understand how or why here? Can you elaborate some (I mean, without writing> for me or anything)?>> Thanks!>> Steve>> ------------------------------------------------> Steven Jarvis> Web Developer> sjarvis@nwaonline.net>> Morning News of Northwest Arkansas> http://www.nwaonline.net> ------------------------------------------------>> -------------------------------------------------------------> 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:
If you are associating a cart# with each user session anyway - then all you need to dois be within an ordefile context (you can wrap a whole page with one) and then theorderfile's headers (the orderfile with the same # as the cart # the user is luggingaround) are available with a simple [headerN] (1-40), or else one of the predefinedones like [city]).(http://betadoc.smithmicro.com/OrderFileFormat.html)If you are on a page where the user got there at the same time you had him use a webcatshopping command (like add, showcart, purchase, remove,...) then you don't even have tobother with the explicit orderfile context - because you are already within an implicitone.So say the user comes to a form for the first time and one of the inputs is this-and say at that moment 'header14' has not yet been given a value in that orderfile. Sothen the HTML that is returned to the browser is- (since in orderfile contexts undefinedheaders act like variables assigned to the null string - same behavior as db fieldswith no value.)Which means the user sees an input with no predefined value. Perfect since this is his1st visit.Now say he fills in the form and submits it so now he is on the next page where you doerror checking. He goofed up something so you instruct him to go back and check hisform values and submit the form again after he corrects his errors. He uses a linkwhich goes back to that page where the form is, and now the HTML that is returned tohis browser is-(if he had input yes for the 'whatever' text input-)See? The orderfile is essentially 2 databases (one for the header data and one for thelineitems) which webcat engineers have made extremely accessible to make your hassle aslittle as possible. You could write an ecommerce site with out every using a webcatorderfile - using all your own custom dbs etc... but why bother? Then everytime youwanted [whatever14] you would have to do this-[Searchdb=custom.db&eqKEYFIELDdatarq=[value]&max=1][founditems][whatever14][/FoundItems][/Search]Plus to get it in there in the first place you would have to use a [append] or[replace]... this is all done for you with webcat orderfiles.-JohnSteven Jarvis wrote:> John,>> I have some questions about something you said earlier, regarding orderfile> headers:>> >>> seems easier to me stick all the field values in orderfile headers so you> >>> can simply use imputs with predefined values equal to those headers.> >>> >> I'm not exactly sure what you mean by using inputs with predefined values.> >> Do you mean the input name equals a particular header?> >> > which will evaluate to-> > > > when Header14 has no value yet, but-> > > > when Header14 has a value of yes already>> What's the advantage of using orderfile headers over a separate database? I> guess I just don't see how using the headers would work for my application> here, especially after re-reading the Tea Room tutorial again. I'm sure that> the headers can be used to do all sorts of cool stuff, I just don't> understand how or why here? Can you elaborate some (I mean, without writing> for me or anything)?>> Thanks!>> Steve>> ------------------------------------------------> Steven Jarvis> Web Developer> sjarvis@nwaonline.net>> Morning News of Northwest Arkansas> http://www.nwaonline.net> ------------------------------------------------>> -------------------------------------------------------------> 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 Butler
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...