Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 47412
interpreted = N
texte = On 2/4/03 12:53 PM, Donovan wrote:> This is probably the order in which the code is being executed but I > guess it could be caching. > > I don't work with commands (less secure). It is probably better to work > with contexts. but since you are using commands you might want to also > post where the add or addlineitems code is along with the display > code below. > Thanks for responding, Donovan. Here is the code from detail.tpl.On other pages I just use:Add to Cart.-Joe ============== START ADD CODE FROM Detail.tpl ============== [!]------------------------------------[/!] [!] [/!][!]------------------------------------[/!]
[!]Include size selection if available[/!] [showif [HasSize]=T] Select Size: [/showif]  [!]Include color selection if available[/!] [showif [HasColor]=T]Select Size: [/showif] 
> ============== END ADD CODE FROM Detail.tpl ============== > > Joe R. Richardson wrote: > >> I'm having a problem listing LineItems on my shopping cart. It functions as >> if it's one iteration out of sync with the shopping cart. If I put something >> in the cart the lineitem doesn't show, but the subtotal does. If I then >> refresh the page, the lineitem shows up as #1, but the subtotal reflects two >> items (twice as much). Then, if you remove that item, both lineitems show, >> but the subTotal goes back. >> >> I placed some test code on the page and they confirm something funny is >> going on. Can anyone tell me what I've done wrong?? >> >> Thanks, >> Joe >> >> Site location: >> ========= START CODE FROM ShoppingCart.tpl =============== >> >>

Your Shopping Cart Contains the Following Items

>>
>> >> >> >> >>
>> >> [!]---Test that anything is being---[/!] >> >> [orderfile cart=[cart]] >> [lineitems] >> [showif [lineindex]>0] >> There are [lineindex] items in your shopping cart.

>> [/showif] >> [/lineitems] >> [/orderfile] >> >> [showif [numlineitems]=0] >> Your cart is empty.
>> Please continue shopping.


>> [/showif] >> >> [!]----End Test------[/!] >> >> >> >> [!]---Header Labels---[/!] >> >> >> >> >> >> >> >> >> >> >> >> >> [!]---Loop thru items in shopping cart---[/!] >> >> [Orderfile cart=[cart]] >> >> [lineitems] >> >> >> >> >> >> >> >> [!]------Show Rat Restrictions-----[/!] >> >> >> [!]------Show selected size--------[/!] >> >> >> [!]------Show selected color-------[/!] >> >> >> >> >> >> >> >> >> >> >> [/lineitems] >> >> [/Orderfile] >> >> [!]---Show the subtotal for all items in cart---[/!] >> >> >> >> >> >> >>
Item #TitleLimitSizeColorQtyPriceQty*PriceAction
[lineindex][Title] >> [showif [Restriction]=Rats Only] >> [Restriction] >> [/showif]None >> >> [hideif ![TextC]] >> [TextC] >> [/hideif]NA >> >> [hideif ![TextD]] >> [TextD] >> [/hideif]NA >> >> > align=right> >> >> $[price] >> >> $[format .2f][math][quantity]*[price][/math][/format] >> > href=ShoppingCart.tpl?command=remove&db=catalog.db&sku=[url][sku][/url]&car >> t=[cart]>Remove Item [lineIndex] >>
Subtotal$[subTotal] 
>> ======================= END CODE FROM ShoppingCart.tpl ================== >> >> >> ------------------------------------------------------------- >> 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://webdna.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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Donovan 2003)
  2. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
  3. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
  4. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (charles kline 2003)
  5. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Donovan 2003)
  6. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
  7. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Donovan 2003)
  8. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
  9. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Donovan 2003)
  10. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
  11. Re: Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Donovan 2003)
  12. Help with [LineItems] in [OrderFile] on ShoppingCart.tpl (Joe R. Richardson 2003)
On 2/4/03 12:53 PM, Donovan wrote:> This is probably the order in which the code is being executed but I > guess it could be caching. > > I don't work with commands (less secure). It is probably better to work > with contexts. but since you are using commands you might want to also > post where the add or addlineitems code is along with the display > code below. > Thanks for responding, Donovan. Here is the code from detail.tpl.On other pages I just use:[cart]&db=catalog.db&sku=[url][sku][ /url]>Add to Cart.-Joe ============== START ADD CODE FROM Detail.tpl ============== [cart]> [!]------------------------------------[/!] [!] [/!][!]------------------------------------[/!]
[!]Include size selection if available[/!] [showif [HasSize]=T] Select Size: [/showif]  [!]Include color selection if available[/!] [showif [HasColor]=T]Select Size: [/showif] 
> ============== END ADD CODE FROM Detail.tpl ============== > > Joe R. Richardson wrote: > >> I'm having a problem listing LineItems on my shopping cart. It functions as >> if it's one iteration out of sync with the shopping cart. If I put something >> in the cart the lineitem doesn't show, but the subtotal does. If I then >> refresh the page, the lineitem shows up as #1, but the subtotal reflects two >> items (twice as much). Then, if you remove that item, both lineitems show, >> but the subTotal goes back. >> >> I placed some test code on the page and they confirm something funny is >> going on. Can anyone tell me what I've done wrong?? >> >> Thanks, >> Joe >> >> Site location: >> ========= START CODE FROM ShoppingCart.tpl =============== >> >>

Your Shopping Cart Contains the Following Items

>>
>> >> [cart]> >> >> >>
>> >> [!]---Test that anything is being---[/!] >> >> [orderfile cart=[cart]] >> [lineitems] >> [showif [lineindex]>0] >> There are [lineindex] items in your shopping cart.

>> [/showif] >> [/lineitems] >> [/orderfile] >> >> [showif [numlineitems]=0] >> Your cart is empty.
>> Please continue shopping.


>> [/showif] >> >> [!]----End Test------[/!] >> >> >> >> [!]---Header Labels---[/!] >> >> >> >> >> >> >> >> >> >> >> >> >> [!]---Loop thru items in shopping cart---[/!] >> >> [Orderfile cart=[cart]] >> >> [lineitems] >> >> >> >> >> >> >> >> [!]------Show Rat Restrictions-----[/!] >> >> >> [!]------Show selected size--------[/!] >> >> >> [!]------Show selected color-------[/!] >> >> >> >> >> >> >> >> >> >> >> [/lineitems] >> >> [/Orderfile] >> >> [!]---Show the subtotal for all items in cart---[/!] >> >> >> >> >> >> >>
Item #TitleLimitSizeColorQtyPriceQty*PriceAction
[lineindex][Title] >> [showif [Restriction]=Rats Only] >> [Restriction] >> [/showif]None >> >> [hideif ![TextC]] >> [TextC] >> [/hideif]NA >> >> [hideif ![TextD]] >> [TextD] >> [/hideif]NA >> >> > align=right> >> >> $[price] >> >> $[format .2f][math][quantity]*[price][/math][/format] >> > href=ShoppingCart.tpl?command=remove&db=catalog.db&sku=[url][sku][/url]&car >> t=[cart]>Remove Item [lineIndex] >>
Subtotal$[subTotal] 
>> ======================= END CODE FROM ShoppingCart.tpl ================== >> >> >> ------------------------------------------------------------- >> 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://webdna.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://webdna.smithmicro.com/ Joe R. Richardson

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:

ShowNext (was New WebCatalog Site) (1997) RE: WebCat: Access denied, but why? (1997) Caching [include] files ... (1997) webcat list slow? (1998) Running _every_ page through WebCat-error.html (1997) WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997) Calendar (1997) Intermitent problem using [referrer] (1997) WC Database Format (1997) All questions are welcome on this list (1997) database visibility (2000) Running _every_ page through WebCat ? (1997) [replaceChars] would be nice ... (1997) WebTen and WebCat (1997) Online reference (1997) Plugin or CGI or both (1997) how to check for no value while using [URL] to prevent cr (1999) Database Strategy - more... (1998) Cookies (2003) [WebDNA] Yosemite (2014)