Re: Problem 2 of 2 (was: Shipping Confusion)

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 35304
interpreted = N
texte = Yeah, the problem is that your hideif is testing the SKU outside of the lineitems loop, so it will always be false. If you always want to have only one SKU=10001, put a [removelineitem] within the [lineitems] loop, then add a single mailing tube afterwards.[lineitems] [showif [url][SKU][/url]=10001] [removelineitem cart=[cart]&index=[lineindex]] [/showif] ... [/lineitems]John PeacockChristopher Mackay wrote: > > Hi all, > > We have three product categories; posters, postcards and books. > Postcards and books have taxes and shipping built-in to their price. > Posters, on the other hand, do not. The mailing tubes in which we > ship the posters cost $5 to mail, and can hold more than one poster. > Therefore, the workaround is to detect the presence of a poster in > the cart and add a mailing tube to the order (price=$0, > unitshipcost=$5). Brilliant. It works. But every time we hit > shoppingcart.tpl or invoice.tpl, another mailing tube gets added, and > they add up quick. If we can get this going, we're set -- we can > figure out how to hide them (to keep people from removing them!) and > how to delete the mailing tube from the order if the user removes all > posters from the cart (I think), but this has us stuck. > > The code (with thanks to John Butler and John Peacock) looks like this: > > [!]This checks the cart for posters, and adds a mailing tube if it > finds one![/!] > > [lineitems] > [showif [url][itemType][/url]=poster] > [text show=F]needsTube=yes[/text] > [/showif] > [/lineitems] > > [hideif [url][SKU][/url]=10001] > [showif [url][needsTube][/url]=yes] > [AddLineItem cart=[cart]&db=tantramar_publishing.db&sku=10001][/AddLineItem] > [/showif] > [/hideif] > > It's adding the mailing tube okay, but the [hideif] context doesn't > prevent it from adding more mailing tubes, which to my eye, it > should. Can anyone spot the problem? > -- > > Regards, > > Christopher Mackay, Director of Technical Services > Tantramar Interactive, http://www.tantramar.com/ > 506/364-1097 cell: 364-7659 fax: 536-2409 > > NEW! Tantramar Vistas: 360-degree photos of Tantramar. > Posters, postcards and a book with bonus CD-ROM for Mac and Windows! > On sale at http://www.tantramarpublishing.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: Problem 2 of 2 (was: Shipping Confusion) (Christopher Mackay 2000)
  2. Re: Problem 2 of 2 (was: Shipping Confusion) (Christopher Mackay 2000)
  3. Re: Problem 2 of 2 (was: Shipping Confusion) (Rob Marquardt 2000)
  4. Re: Problem 2 of 2 (was: Shipping Confusion) (John Peacock 2000)
  5. Re: Problem 2 of 2 (was: Shipping Confusion) (John Butler 2000)
  6. Re: Problem 2 of 2 (was: Shipping Confusion) (Christopher Mackay 2000)
  7. Re: Problem 2 of 2 (was: Shipping Confusion) (John Peacock 2000)
  8. Re: Problem 2 of 2 (was: Shipping Confusion) (Christopher Mackay 2000)
  9. Re: Problem 2 of 2 (was: Shipping Confusion) (John Butler 2000)
  10. Problem 2 of 2 (was: Shipping Confusion) (Christopher Mackay 2000)
Yeah, the problem is that your hideif is testing the SKU outside of the lineitems loop, so it will always be false. If you always want to have only one SKU=10001, put a [removelineitem] within the [lineitems] loop, then add a single mailing tube afterwards.[lineitems] [showif [url][SKU][/url]=10001] [removelineitem cart=[cart]&index=[lineindex]] [/showif] ... [/lineitems]John PeacockChristopher Mackay wrote: > > Hi all, > > We have three product categories; posters, postcards and books. > Postcards and books have taxes and shipping built-in to their price. > Posters, on the other hand, do not. The mailing tubes in which we > ship the posters cost $5 to mail, and can hold more than one poster. > Therefore, the workaround is to detect the presence of a poster in > the cart and add a mailing tube to the order (price=$0, > unitshipcost=$5). Brilliant. It works. But every time we hit > shoppingcart.tpl or invoice.tpl, another mailing tube gets added, and > they add up quick. If we can get this going, we're set -- we can > figure out how to hide them (to keep people from removing them!) and > how to delete the mailing tube from the order if the user removes all > posters from the cart (I think), but this has us stuck. > > The code (with thanks to John Butler and John Peacock) looks like this: > > [!]This checks the cart for posters, and adds a mailing tube if it > finds one![/!] > > [lineitems] > [showif [url][itemType][/url]=poster] > [text show=F]needsTube=yes[/text] > [/showif] > [/lineitems] > > [hideif [url][SKU][/url]=10001] > [showif [url][needsTube][/url]=yes] > [AddLineItem cart=[cart]&db=tantramar_publishing.db&sku=10001][/AddLineItem] > [/showif] > [/hideif] > > It's adding the mailing tube okay, but the [hideif] context doesn't > prevent it from adding more mailing tubes, which to my eye, it > should. Can anyone spot the problem? > -- > > Regards, > > Christopher Mackay, Director of Technical Services > Tantramar Interactive, http://www.tantramar.com/ > 506/364-1097 cell: 364-7659 fax: 536-2409 > > NEW! Tantramar Vistas: 360-degree photos of Tantramar. > Posters, postcards and a book with bonus CD-ROM for Mac and Windows! > On sale at http://www.tantramarpublishing.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/ John Peacock

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:

Problems searching from a FORM (1997) The Guru Speaks (1998) [newcart] (1998) [showif] / [hideif] (1997) Separate SSL Server (1997) Date Range search (1997) PIXO support (1997) So much more than a Software Developer (2004) grep question - how to strip spaces from the beginning ofa string? (2002) Date search - yes or no (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) searchable list archive (1997) Drop Down Menus (2002) New Mac Public Beta Available (1997) Here's how to kill a Butler Database. (1997) Trunk-gator (1997) 2.1 bugs left over from beta cycle (1998) Emailer choke (1997) Purchase Plugin Missing (1996) Roundup function? (1997)