Re: Adding more than one item and QTY to cart

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 34222
interpreted = N
texte = hello:I had that error before. My problem was that I forgot to put a bracket( [] ) in one of the tags. I would double check really carefully if you have all your tags and also if you have them spelled correctly.Arturo Vargas The World Wide Web Store-----Original Message----- From: WebCatalog Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of Tim Robinson Sent: Wednesday, July 05, 2000 7:58 PM To: WebCatalog Talk Subject: Re: Adding more than one item and QTY to cart Hi John (or anyone else who could assist),Thanks so much for your help. I'm slowly getting to grips with the code. I've put your suggestions into place, and I get an error on my cart.tpl page. And it doesn't add the line item. Here's the error. -- [AddLineItem db=/orgmech_internal/orgmech.db&cart=3045732710226&sku=APP002]quantity=2Erro r: Error: expected [/HIDEIF], but found [/AddLineItem] instead[/AddLineItem] -- This seems to indicate that it IS passing the correct SKU, cart & QTY. The same message duplicates for each line of the results.tpl page where there was a QTY entered into the form (ie. if there were three products with a value entered, there will be three of the full error messages each with the correct SKU and QTY).Any ideas.....Regards, TimTim Robinson Art Director imagine online tim@imagine.au.com http://www.imagine.au.comOn Thursday, 6 July 2000, John Butler wrote: >Tim, > >you need to pass a SKU value for each item that is to end up >getting added to the cart. But You have to use neat tricks so >that each item has its own SKU passed via a unique var name >(since each item has a different sku, you can't simply pass sku=123 >because then >this code: >[formvariables name=qty_&exact=f] >[AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][SKU][/url]]quantity=[ qty_[index]][/AddLineItem] >[/formvariables] > >would lookup the SAME SKU (123) each time it added a different >item. > >Also notice that [qty_[index]] will evaluate to [qty_1], >[qty_2], [qty_3], if there were 3 founditems. You should use >[interpret][qty_[index]][/interpret] so that it evaluates to >the actual value of [qty_1], [qty_2], [qty_3], (ie. 1,7,2 - if for >example the user input: 1 of item 1, 7 of item 2, and 2 of item >3.) > >So this is the kind of technique you would also need for the >unique SKU vars. On results.tpl, something like this: >[founditems] > >[SKU] >[PRODUCT] > >$[format .2f][PRICE][/format] / [UNIT] > >[/founditems] > >and on cart.tp: >[formvariables name=qty_&exact=f] >[hideif [URL][value][/URL]=] >[AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][interpret][sku_[index ]][/interpret][/url]]quantity=[interpret][qty_[index]][/interpret][/AddLineI tem] >[/hideif] >[/formvariables] > >notice you could if you wanted (I think) change >'[interpret][qty_[index]][/interpret]' to '[value]' since >within the [formvariables] loop the value of the [qty_[index]] >var is available via simply '[value]'. > >the hideif hides the [addlineitem] in the cases where the user >did not input any qty. > >This is all off the top of my head and I may have goofed >something up, but you are now hopefully exposed to >concepts/techniques that you can use to get it right in case I >goofed up. > >HTH > >-John > >Tim Robinson wrote: > >> Hi there, >> >> There's a number of items in the searchable archives, and I HAVE tried. >> >> I would like to add a number of products to the cart at once, >but only if there is a QTY specified for the product. I don't >want to have to check a checkbox or anything, just fill in a QTY. >> >> I understand the cart page needs to have a [FormVariables] >and [AddLineItem], but I can't seem to get it to work.... >> >> Here's the results.tpl stuff: >> >>
>> >> >> >> >> >> >> >> >> >> >> [founditems] >> >> >> >> >> >> >> [/founditems] >> >>
SKUPRODUCTQTYPRICE / UNIT
[SKU][PRODUCT]$[format .2f][PRICE][/format] / [UNIT]
>> >> >>
>> >> Here's the cart.tpl stuff: >> >> [formvariables name=qty_&exact=f] >> [AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][SKU][/url]]quantity=[ qty_[index]][/AddLineItem] >> [/formvariables] >> >>
>> >> >> >> >> >> >> >> >> >> >> >> >> [lineItems] >> >> >> >> >> >> >> >> >> [/lineItems] >> >>
Line #Product #Item TitleQtyPricePut It Back!
[lineIndex][SKU][PRODUCT]sans-serif>$[format .2f][price][/format]> >HREF=Cart.tpl?command=remove&db=/orgmech_internal/orgmech.db&index=[lineIn dex]&cart=[cart]>Remove Item
>>

>> >>

>> >> There's obviously something I'm missing. At the moment, the >cart.tpl displays the message Error: couldn't find SKU '[SKU]' >in product database Error: couldn't find SKU '[SKU]' in product >database Error: couldn't find SKU '[SKU]' in product database. >> >> I want the QTY to remain editable in the cart page. >> >> Any help would be so hugely appreciated, and good karma is guaranteed... >> >> Regards, >> Tim >> >> Tim Robinson >> Art Director >> imagine online >> tim@imagine.au.com >> http://www.imagine.au.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/ >------------------------------------------------------------- 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:

    
  1. Re: Adding more than one item and QTY to cart (John Butler 2000)
  2. Re: Adding more than one item and QTY to cart (Tim Robinson 2000)
  3. Re: Adding more than one item and QTY to cart (Arturo Vargas 2000)
  4. Re: Adding more than one item and QTY to cart (John Butler 2000)
  5. Re: Adding more than one item and QTY to cart (Tim Robinson 2000)
  6. Re: Adding more than one item and QTY to cart (John Butler 2000)
  7. Adding more than one item and QTY to cart (Tim Robinson 2000)
hello:I had that error before. My problem was that I forgot to put a bracket( [] ) in one of the tags. I would double check really carefully if you have all your tags and also if you have them spelled correctly.Arturo Vargas The World Wide Web Store-----Original Message----- From: WebCatalog Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of Tim Robinson Sent: Wednesday, July 05, 2000 7:58 PM To: WebCatalog Talk Subject: Re: Adding more than one item and QTY to cart Hi John (or anyone else who could assist),Thanks so much for your help. I'm slowly getting to grips with the code. I've put your suggestions into place, and I get an error on my cart.tpl page. And it doesn't add the line item. Here's the error. -- [AddLineItem db=/orgmech_internal/orgmech.db&cart=3045732710226&sku=APP002]quantity=2Erro r: Error: expected [/HIDEIF], but found [/AddLineItem] instead[/AddLineItem] -- This seems to indicate that it IS passing the correct SKU, cart & QTY. The same message duplicates for each line of the results.tpl page where there was a QTY entered into the form (ie. if there were three products with a value entered, there will be three of the full error messages each with the correct SKU and QTY).Any ideas.....Regards, TimTim Robinson Art Director imagine online tim@imagine.au.com http://www.imagine.au.comOn Thursday, 6 July 2000, John Butler wrote: >Tim, > >you need to pass a SKU value for each item that is to end up >getting added to the cart. But You have to use neat tricks so >that each item has its own SKU passed via a unique var name >(since each item has a different sku, you can't simply pass sku=123 >because then >this code: >[formvariables name=qty_&exact=f] >[AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][SKU][/url]]quantity=[ qty_[index]][/AddLineItem] >[/formvariables] > >would lookup the SAME SKU (123) each time it added a different >item. > >Also notice that [qty_[index]] will evaluate to [qty_1], >[qty_2], [qty_3], if there were 3 founditems. You should use >[interpret][qty_[index]][/interpret] so that it evaluates to >the actual value of [qty_1], [qty_2], [qty_3], (ie. 1,7,2 - if for >example the user input: 1 of item 1, 7 of item 2, and 2 of item >3.) > >So this is the kind of technique you would also need for the >unique SKU vars. On results.tpl, something like this: >[founditems] > >[SKU] >[PRODUCT] > >$[format .2f][PRICE][/format] / [UNIT] > >[/founditems] > >and on cart.tp: >[formvariables name=qty_&exact=f] >[hideif [url][value][/URL]=] >[AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][interpret][sku_[index ]][/interpret][/url]]quantity=[interpret][qty_[index]][/interpret][/AddLineI tem] >[/hideif] >[/formvariables] > >notice you could if you wanted (I think) change >'[interpret][qty_[index]][/interpret]' to '[value]' since >within the [formvariables] loop the value of the [qty_[index]] >var is available via simply '[value]'. > >the hideif hides the [addlineitem] in the cases where the user >did not input any qty. > >This is all off the top of my head and I may have goofed >something up, but you are now hopefully exposed to >concepts/techniques that you can use to get it right in case I >goofed up. > >HTH > >-John > >Tim Robinson wrote: > >> Hi there, >> >> There's a number of items in the searchable archives, and I HAVE tried. >> >> I would like to add a number of products to the cart at once, >but only if there is a QTY specified for the product. I don't >want to have to check a checkbox or anything, just fill in a QTY. >> >> I understand the cart page needs to have a [formvariables] >and [addlineitem], but I can't seem to get it to work.... >> >> Here's the results.tpl stuff: >> >>
>> [cart]> >> >> >> >> >> >> >> >> >> >> [founditems] >> >> >> >> >> >> >> [/founditems] >> >>
SKUPRODUCTQTYPRICE / UNIT
[SKU][PRODUCT]$[format .2f][PRICE][/format] / [UNIT]
>> >> >>
>> >> Here's the cart.tpl stuff: >> >> [formvariables name=qty_&exact=f] >> [AddLineItem >db=/orgmech_internal/orgmech.db&cart=[cart]&sku=[url][SKU][/url]]quantity=[ qty_[index]][/AddLineItem] >> [/formvariables] >> >>
>> [cart]> >> >> >> >> >> >> >> >> >> >> >> >> [lineitems] >> >> >> >> >> >> >> >> >> [/lineItems] >> >>
Line #Product #Item TitleQtyPricePut It Back!
[lineIndex][SKU][PRODUCT]sans-serif>$[format .2f][price][/format]> >HREF=Cart.tpl?command=remove&db=/orgmech_internal/orgmech.db&index=[lineIn dex]&cart=[cart]>Remove Item
>>

>> >>

>> >> There's obviously something I'm missing. At the moment, the >cart.tpl displays the message Error: couldn't find SKU '[SKU]' >in product database Error: couldn't find SKU '[SKU]' in product >database Error: couldn't find SKU '[SKU]' in product database. >> >> I want the QTY to remain editable in the cart page. >> >> Any help would be so hugely appreciated, and good karma is guaranteed... >> >> Regards, >> Tim >> >> Tim Robinson >> Art Director >> imagine online >> tim@imagine.au.com >> http://www.imagine.au.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/ >------------------------------------------------------------- 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/ Arturo Vargas

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:

WebMerchant & AuthorizeNet (2000) Teaching Help! (2000) ShowNext Command (1997) problems with WebCat-Plugin (1997) IIS error and webcat (2000) pc (1997) No luck with taxes (1997) Sorting by date (1997) We are searching (2005) Re:Emailer and encryption (1997) Search/sort in URL Was: GuestBook example (1997) Problem with CC problem ? (1997) Printing from Web pages (1998) Loosing Quantity (2000) [showif] question (2000) Sum of Quantities (1997) Director 7 (1999) Malformed Pages (1999) [ShowNext] feature in 2.0 (1997) Nested tags count question (1997)