Re: Colors in cart

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 41294
interpreted = N
texte = it is adding the product twice because you are adding it with the command add, and then with the with the addlineitem context. If you want to use the context in the shoppingcart page, make sure that your context appears before your cart display in the code. You may need to set the mimeheaders in the shoppincart page not to cache also (look in the archives for this code). For simplicity, if you want to stick with just the command, get rid of the addlineitem context in the shoppingcart page and rename your select menus like... and This should do it. Sorry if I'm making this confusing!stephen wrote:> I tried the code and the shopping cart comes up blank. > If I change action to command and value equals add, then I get it to come up but it is adding the product twice. > > S- > > -----Original Message----- > From: Robert Wade [mailto:robert@outboundcreative.com] > Sent: Tuesday, July 09, 2002 11:30 AM > To: WebCatalog Talk > Subject: Re: Colors in cart > > Well, I can tell a few things that are wrong here. > > - You are sending the add command to the next page, and you are also using an addlineitem context. These both accomplish the same > task. I would remove the add command. As a rule, I always use contexts rather than commands when available. If you need to > determine what happens on your shoppincart page when accessed, change command to action or something like that. Then use > [showif [action]=add]. action is not a webdna tag, so it will be treated as a simple variable, and will work with your showif to > determine what happens on that page. > > - Somewhere on the page, you need to specify a quantity of the product being added, as in a hidden input variable, or a text input, > or you can hardcode it in the addlineitem context on the shoppincart page. The test you ran would have actually added a quantity of > the text [quantity] since there was no variable passed. > > Try this code instead.... (don't forget to remove linebreaks caused by the email app) > > ==================== >
> > > > > > > >
> > >
>
> > >
>
>
> > > > > >
> > > >
> > ======================== > And in your shoppincart page use this.... > > [showif [action]=add] > [addlineitem > cart=[cart]&sku=[sku]&db=[db]]quantity=[_quantity]&texta=[selectedsizes]&textb=[selectedcolors]&textc=[style][/addlineitem] > [/showif] > > ( I wasn't sure what [style] was so I put it in textc. You can remove that part if you need. You don't need the formvariables loop > UNLESS you are planning on adding multiple items with one click. If you do this you have to re-do how you name your select menus > and then pull the values out in the addlineitem. for instance your select name might be > > > > > > > > > > > >
> > > > > >
> >
> > > > > >
> >
> >
> > > > > > > > > > > >
> > > > > > > > > > > > > > S- > > > > -----Original Message----- > > From: Robert Wade [mailto:robert@outboundcreative.com] > > Sent: Tuesday, July 09, 2002 11:03 AM > > To: WebCatalog Talk > > Subject: Re: Colors in cart > > > > Post the code from your form, in the previous page. Also what is the value of the formvariable font. Is that value a sku > > number in your amdv.db? make sure that [quantity] is a correct value to. Are you using the formvariables loop because you > > are offering them the option to add more than 1 item at the same time? > > > > stephen wrote: > > > > > When I add the following code, from your suggestions, the values are still coming up blank. > > > > > > [showif [command]=add] [formvariables name=Font][addlineitem cart=[cart]&sku=[value]&db=admin/amdv.db]quantity=[quantity] > > > &texta=[selectedsizes]&textb=[selectedcolors][/addlineitem][/formvariables][/showif] > > > > > > S- > > > > > > -----Original Message----- > > > From: Robert Wade [mailto:robert@outboundcreative.com] > > > Sent: Tuesday, July 09, 2002 10:26 AM > > > To: WebCatalog Talk > > > Subject: Re: Colors in cart > > > > > > You might want to consider just setting the texta and text be fields when you add the item with your addlineitem > > > and get rid of that setlineitem context all together. > > > > > > [addlineitem > > > cart=[cart]&sku=[sku]&db=yourdatabase.db]quantity=[quantity]&texta=[selectedsizes]&textb=[selectedcolors][/addlineitem] > > > > > > Also know that when using a setlineitem you have to define which lineitem you are setting. You do this with the > > > index= parameter. > > > > > > [setlineitem > > > cart=[cart]&index=[yourIndexValue]]quantity=[quantity]&texta=[selectedsizes]&textb=[selectedcolors][/setlineitem] > > > > > > You have to define somehow your index value. Usually the setlineitem might be within a lineitems loop, and using > > > a showif to determine which one shows. If you are using a lineitems loop you would use [lineindex] as the value. > > > > > > This is all in the docs, BTW. > > > > > > HTH -Robert > > > > > > stephen wrote: > > > > > > > On the shoppingcart page, after the ADDLINEITEM tag, I have: > > > > > > > > [setlineitem cart=[cart]]texta=[selectedsizes]&textb=[selectedcolors][/setlineitem] > > > > > > > > Then in the lineitems section, cart, I have [texta] to show size and [textb] to show color. > > > > > > > > It is coming up blank now. > > > > > > > > -----Original Message----- > > > > From: Robert Wade [mailto:robert@outboundcreative.com] > > > > Sent: Tuesday, July 09, 2002 9:54 AM > > > > To: WebCatalog Talk > > > > Subject: Re: Colors in cart > > > > > > > > Make sure you save the value in one of the text headers of your lineitems. (texta, textb, textc, textd, or > > > > texte). You may want to post your addlineitem or setlineitem contexts that you are using so we can get a > > > > better idea of what you're doing wrong. > > > > > > > > stephen wrote: > > > > > > > > > I am having the user select a color before they add it to the cart. > > > > > I pass the value thru the form calling it selectedcolor. > > > > > > > > > > It works, but when I add another item with a different color, it changes the other item to that color value. > > > > > > > > > > How can make each color be unique to its lineitem? > > > > > > > > > > S- > > > > > > > > > > ------------------------------------------------------------- > > > > > 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/ > > > > > > > > -- > > > > > > > > ================================================ > > > > Robert Wade > > > > Outbound Creative, Inc. > > > > robert@outboundcreative.com > > > > ================================================ > > > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > > > ================================================ > > > > > > > > ------------------------------------------------------------- > > > > 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/ > > > > > > -- > > > > > > ================================================ > > > Robert Wade > > > Outbound Creative, Inc. > > > robert@outboundcreative.com > > > ================================================ > > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > > ================================================ > > > > > > ------------------------------------------------------------- > > > 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/ > > > > -- > > > > ================================================ > > Robert Wade > > Outbound Creative, Inc. > > robert@outboundcreative.com > > ================================================ > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > ================================================ > > > > ------------------------------------------------------------- > > 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/ > > -- > > ================================================ > Robert Wade > Outbound Creative, Inc. > robert@outboundcreative.com > ================================================ > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > ================================================ > > ------------------------------------------------------------- > 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/--================================================ Robert Wade Outbound Creative, Inc. robert@outboundcreative.com ================================================ |[ ] L|| ‘||‘ ||} |[ ] L|| ||\| ||) ================================================------------------------------------------------------------- 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: Colors in cart (Robert Wade 2002)
  2. Re: Colors in cart (Robert Wade 2002)
  3. Re: Colors in cart (stephen 2002)
  4. Re: Colors in cart (Robert Wade 2002)
  5. Re: Colors in cart (stephen 2002)
  6. Re: Colors in cart (Robert Wade 2002)
  7. Re: Colors in cart (stephen 2002)
  8. Re: Colors in cart (Robert Wade 2002)
  9. Re: Colors in cart (stephen 2002)
  10. Re: Colors in cart (Robert Wade 2002)
  11. Colors in cart (stephen 2002)
it is adding the product twice because you are adding it with the command add, and then with the with the addlineitem context. If you want to use the context in the shoppingcart page, make sure that your context appears before your cart display in the code. You may need to set the mimeheaders in the shoppincart page not to cache also (look in the archives for this code). For simplicity, if you want to stick with just the command, get rid of the addlineitem context in the shoppingcart page and rename your select menus like... and This should do it. Sorry if I'm making this confusing!stephen wrote:> I tried the code and the shopping cart comes up blank. > If I change action to command and value equals add, then I get it to come up but it is adding the product twice. > > S- > > -----Original Message----- > From: Robert Wade [mailto:robert@outboundcreative.com] > Sent: Tuesday, July 09, 2002 11:30 AM > To: WebCatalog Talk > Subject: Re: Colors in cart > > Well, I can tell a few things that are wrong here. > > - You are sending the add command to the next page, and you are also using an addlineitem context. These both accomplish the same > task. I would remove the add command. As a rule, I always use contexts rather than commands when available. If you need to > determine what happens on your shoppincart page when accessed, change command to action or something like that. Then use > [showif [action]=add]. action is not a webdna tag, so it will be treated as a simple variable, and will work with your showif to > determine what happens on that page. > > - Somewhere on the page, you need to specify a quantity of the product being added, as in a hidden input variable, or a text input, > or you can hardcode it in the addlineitem context on the shoppincart page. The test you ran would have actually added a quantity of > the text [quantity] since there was no variable passed. > > Try this code instead.... (don't forget to remove linebreaks caused by the email app) > > ==================== >
> [cart]> > > > > > > >
> > >
>
> > >
>
>
> > > > > >
> > > > >
> ======================== > And in your shoppincart page use this.... > > [showif [action]=add] > [addlineitem > cart=[cart]&sku=[sku]&db=[db]]quantity=[_quantity]&texta=[selectedsizes]&textb=[selectedcolors]&textc=[style][/addlineitem] > [/showif] > > ( I wasn't sure what [style] was so I put it in textc. You can remove that part if you need. You don't need the formvariables loop > UNLESS you are planning on adding multiple items with one click. If you do this you have to re-do how you name your select menus > and then pull the values out in the addlineitem. for instance your select name might be [cart]> > > > > > > > > > > > >
> > > > > >
> >
> > > > > >
> >
> >
> > > > > > > > > > > >
> > > > > > > > > > > > > > S- > > > > -----Original Message----- > > From: Robert Wade [mailto:robert@outboundcreative.com] > > Sent: Tuesday, July 09, 2002 11:03 AM > > To: WebCatalog Talk > > Subject: Re: Colors in cart > > > > Post the code from your form, in the previous page. Also what is the value of the formvariable font. Is that value a sku > > number in your amdv.db? make sure that [quantity] is a correct value to. Are you using the formvariables loop because you > > are offering them the option to add more than 1 item at the same time? > > > > stephen wrote: > > > > > When I add the following code, from your suggestions, the values are still coming up blank. > > > > > > [showif [command]=add] [formvariables name=Font][addlineitem cart=[cart]&sku=[value]&db=admin/amdv.db]quantity=[quantity] > > > &texta=[selectedsizes]&textb=[selectedcolors][/addlineitem][/formvariables][/showif] > > > > > > S- > > > > > > -----Original Message----- > > > From: Robert Wade [mailto:robert@outboundcreative.com] > > > Sent: Tuesday, July 09, 2002 10:26 AM > > > To: WebCatalog Talk > > > Subject: Re: Colors in cart > > > > > > You might want to consider just setting the texta and text be fields when you add the item with your addlineitem > > > and get rid of that setlineitem context all together. > > > > > > [addlineitem > > > cart=[cart]&sku=[sku]&db=yourdatabase.db]quantity=[quantity]&texta=[selectedsizes]&textb=[selectedcolors][/addlineitem] > > > > > > Also know that when using a setlineitem you have to define which lineitem you are setting. You do this with the > > > index= parameter. > > > > > > [setlineitem > > > cart=[cart]&index=[yourIndexValue]]quantity=[quantity]&texta=[selectedsizes]&textb=[selectedcolors][/setlineitem] > > > > > > You have to define somehow your index value. Usually the setlineitem might be within a lineitems loop, and using > > > a showif to determine which one shows. If you are using a lineitems loop you would use [lineindex] as the value. > > > > > > This is all in the docs, BTW. > > > > > > HTH -Robert > > > > > > stephen wrote: > > > > > > > On the shoppingcart page, after the ADDLINEITEM tag, I have: > > > > > > > > [setlineitem cart=[cart]]texta=[selectedsizes]&textb=[selectedcolors][/setlineitem] > > > > > > > > Then in the lineitems section, cart, I have [texta] to show size and [textb] to show color. > > > > > > > > It is coming up blank now. > > > > > > > > -----Original Message----- > > > > From: Robert Wade [mailto:robert@outboundcreative.com] > > > > Sent: Tuesday, July 09, 2002 9:54 AM > > > > To: WebCatalog Talk > > > > Subject: Re: Colors in cart > > > > > > > > Make sure you save the value in one of the text headers of your lineitems. (texta, textb, textc, textd, or > > > > texte). You may want to post your addlineitem or setlineitem contexts that you are using so we can get a > > > > better idea of what you're doing wrong. > > > > > > > > stephen wrote: > > > > > > > > > I am having the user select a color before they add it to the cart. > > > > > I pass the value thru the form calling it selectedcolor. > > > > > > > > > > It works, but when I add another item with a different color, it changes the other item to that color value. > > > > > > > > > > How can make each color be unique to its lineitem? > > > > > > > > > > S- > > > > > > > > > > ------------------------------------------------------------- > > > > > 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/ > > > > > > > > -- > > > > > > > > ================================================ > > > > Robert Wade > > > > Outbound Creative, Inc. > > > > robert@outboundcreative.com > > > > ================================================ > > > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > > > ================================================ > > > > > > > > ------------------------------------------------------------- > > > > 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/ > > > > > > -- > > > > > > ================================================ > > > Robert Wade > > > Outbound Creative, Inc. > > > robert@outboundcreative.com > > > ================================================ > > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > > ================================================ > > > > > > ------------------------------------------------------------- > > > 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/ > > > > -- > > > > ================================================ > > Robert Wade > > Outbound Creative, Inc. > > robert@outboundcreative.com > > ================================================ > > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > > ================================================ > > > > ------------------------------------------------------------- > > 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/ > > -- > > ================================================ > Robert Wade > Outbound Creative, Inc. > robert@outboundcreative.com > ================================================ > |[ ] L|| '||' ||} |[ ] L|| ||\| ||) > ================================================ > > ------------------------------------------------------------- > 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/--================================================ Robert Wade Outbound Creative, Inc. robert@outboundcreative.com ================================================ |[ ] L|| ‘||‘ ||} |[ ] L|| ||\| ||) ================================================------------------------------------------------------------- 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/ Robert Wade

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:

SiteGuard Admin Feature ? (1997) shipcost (1997) OT: question about traveling abroad (UK) (2005) How can I Add several Items into the cart at once? (1997) Re:Can this be done? (1997) [BULK] [WebDNA] Can WebDNA corrupt a db? (2012) Catalogs and W* (1996) [BULK] [WebDNA] Anyone using WebDNA7 and Lion Server? (2011) Shopping carts and reloading pages (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Re:Variable Math (1998) Webcat no longer supported? (2006) AppleScript question (1997) Upcoming 2.1 Release and PCS Committment (1997) Plugin or CGI or both (1997) Major Security Hole IIS NT (1998) Emailer setup (1997) Multiple prices (1997) AD Error Msg (1997) RequiredFields template (1997)