numero = 12411
interpreted = N
texte = >Perhaps I am making this out to be more complicated than it is.It sounds about right to me. HTML aften forces things to be more complicated than any of us would like, though.>To cut to the chase, all I really want is for certain products to have>quantity minimums, when reaching the invoice.tmpl page which shows the>cart that they are about to purchase.Yes, and my technique does this, as far as I can tell. It cleans up any bad numbers the visitor entered on the previous page, and changes the order file before they see it displayed.>On the cart.tmpl page, there is a option for the quantity. For>certain items, they have to put in a minimum. But of course, there are>going to be people who will put in less than the minimum. I want to be able>to prevent this by having a default quantity that shows up on the>invoice.tmpl page, if they indeed put in less than they are supposed to.Yes, and if they type in a number too small, you can't do anything about it until they arrive at the next page.>This means I should have the quantity permanently set on the cart.tmpl page>instead of the inovice.tmpl page. I assume then that I have to do something>a certain field on my store.tmpl (where all my products are listed) page so>that the quantities on the cart.tmpl page, show up correctly.I suggest you add an extra field to your product database that indicates the minimum order quantity for that product. That way you can pre-type the minimum number into the textarea field. Then of course later you must verify they didn't type a lower number, so there you must bump the number up to the minimum after you learn what number they typed.I've never seen your sequence of pages, so I'll guess the order from what you've said:New catalog database field called minimum-- cart.tmpl --[lineitems][/lineItems]-- invoice.tmpl --[lineitems][showif [quantity]<[minimum]][SetLineItem cart=[cart]&index=[lineindex]&db=catalog.txt]quantity=[minimum][/SetLineItem][/showif][/lineitems][OrderFile ShoppingCarts/[cart]][lineitems]...[sku], [price], [quantity][/lineitems][/OrderFile]WebCatalog should be smart enough to see that [minimum] tag and realize that inside the context of a [lineitems] loop, it should go look up the database value that corresponds to that particular lineitem's sku, and return the field value for [minimum]. If it's not smart enough to do that, then you may need to change that to a [lookup] that explicitly performs a lookup for the sku of that lineitem.In case anyone was wondering why we require you to specify a database when you $Add to your shopping cart, that's why: WebCatalog needs to know what database to look in when it's trying to display things like [title] or [description] inside a lineitems loop. It can't just guess what those values are, because for all we know, you have dozens of different stores with their own databases.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors =====Pacific Coast Software | WebCatalog Pro, WebCommerce Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com
Associated Messages, from the most recent to the oldest:
>Perhaps I am making this out to be more complicated than it is.It sounds about right to me. HTML aften forces things to be more complicated than any of us would like, though.>To cut to the chase, all I really want is for certain products to have>quantity minimums, when reaching the invoice.tmpl page which shows the>cart that they are about to purchase.Yes, and my technique does this, as far as I can tell. It cleans up any bad numbers the visitor entered on the previous page, and changes the order file before they see it displayed.>On the cart.tmpl page, there is a option for the quantity. For>certain items, they have to put in a minimum. But of course, there are>going to be people who will put in less than the minimum. I want to be able>to prevent this by having a default quantity that shows up on the>invoice.tmpl page, if they indeed put in less than they are supposed to.Yes, and if they type in a number too small, you can't do anything about it until they arrive at the next page.>This means I should have the quantity permanently set on the cart.tmpl page>instead of the inovice.tmpl page. I assume then that I have to do something>a certain field on my store.tmpl (where all my products are listed) page so>that the quantities on the cart.tmpl page, show up correctly.I suggest you add an extra field to your product database that indicates the minimum order quantity for that product. That way you can pre-type the minimum number into the textarea field. Then of course later you must verify they didn't type a lower number, so there you must bump the number up to the minimum after you learn what number they typed.I've never seen your sequence of pages, so I'll guess the order from what you've said:New catalog database field called minimum-- cart.tmpl --[lineitems][/lineItems]-- invoice.tmpl --[lineitems][showif [quantity]<[minimum]][SetLineItem cart=[cart]&index=[lineindex]&db=catalog.txt]quantity=[minimum][/SetLineItem][/showif][/lineitems][OrderFile ShoppingCarts/[cart]][lineitems]...[sku], [price], [quantity][/lineitems][/OrderFile]WebCatalog should be smart enough to see that [minimum] tag and realize that inside the context of a [lineitems] loop, it should go look up the database value that corresponds to that particular lineitem's sku, and return the field value for [minimum]. If it's not smart enough to do that, then you may need to change that to a [lookup] that explicitly performs a lookup for the sku of that lineitem.In case anyone was wondering why we require you to specify a database when you $Add to your shopping cart, that's why: WebCatalog needs to know what database to look in when it's trying to display things like [title] or [description] inside a lineitems loop. It can't just guess what those values are, because for all we know, you have dozens of different stores with their own databases.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors =====Pacific Coast Software | WebCatalog Pro, WebCommerce Solution11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMasterSan Diego, CA 92128 | SiteGuard619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com
Grant Hulbert
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...