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 thelineitems loop, so it will always be false. If you always want to haveonly 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:
Yeah, the problem is that your hideif is testing the SKU outside of thelineitems loop, so it will always be false. If you always want to haveonly 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:
cookie length (1998)
[WebDNA] [WSC] WebDNA Development Summit (2014)
Part Html part WebDNA (1997)
emailer cc to figured out (1997)
Plugin or CGI or both (1997)
Session Number (1998)
Sorting Numbers (1997)
Textarea (1998)
Search/sort in URL Was: GuestBook example (1997)
Creating main- and sub-category search (1997)
japanese characters (1997)
Problem with webcat install (1998)
[WebDNA] CICADA (2008)
Assigning carts (1998)
Falsifying [BROWSERNAME] (1998)
PIXO (1997)
Here we go again... (2006)
WebCat2b15MacPlugin - [protect] (1997)
Dynamically Generated Pages & WC? (2000)
Converting Esiting Html Table Forms to WebCat (1997)