LOOP and IF statements

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13572
interpreted = N
texte = I'm trying to do three things at the moment, that I can't quite figure out... some are probably quite simple, but then again...ONE, on the shopping cart page, I have the shipping options listed (WEB, UPS, FedEx) - and I want to only show the client/customer the available options to them at the moment. So, if they're NOT ordering something that is electronically deliverable, WEB shouldn't be an option.I'm thinking that I need to do a [loop][/loop] around a [showif][/showif] that parses [lineitems][/lineitems] to check to see if [canEmail] is T. After it determines that, build a pop-up menu (or radio button) to select the RELEVANT shipping method. Did I mention it shouldn't duplicate the available options? (finished list should NOT look like this: WEB, UPS, WEB, WEB, FedEx - but THIS: WEB, UPS, FedEx)I was trying the following snippet on the ShoppingCart.tmpl page from the General Store example:[lineItems] [showif [CanEmail]=]DELIVERABLE STATUS UNKNOWN
[/showif] [showif [CanEmail]=F]CANNOT BE DELIVERED ELECTRONICALLY
[/showif] [showif [CanEmail]=T]WEB DELIVERY
[/showif] [showif [category]=SEMINAR]Seminar - no delivery necessary
[/showif] [/lineItems]and does indeed do the showif, but I have the duplicated options problem I described above.TWO, Like some other folks, I'd like to be able to keep a database of rights/preferences for our web-enabled clients, so I can store their billing information (except for credit card # - or perhaps last 5 digits only), and their current access rights to various databases we plan on making available to PAID CLIENTS ONLY.For this, I need a few bits of information about the client: All Billing Info, client id (serial #, e-mail, username - possibilities), password, authorized areas, authorization begin date, authorization end date. So, if they're in the database, and enter the correct username and password, they can get access into whatever database we make available to them, as long as TODAY falls within their start and end dates.I understand that I probably need to do a [lookup] into a database that's storing all of this data, but I'm unsure how to proceed beyond that (like the other fellow on the list).Addendum - of course, I need to get the start/end date and area information into the above mentioned database as well, and it would be best if the final purchase command could create or append their current purchases to make instant gratification possible... otherwise, it would have to wait until I (or someone I train) gets the e-mail notification that a client's privileges have changed. This is a task I'm having a hard time visualizing in WebDNA. Any pointers?THREE, Taxes... Ugh. Some of our products/services are taxable, some aren't. For example, Seminar attendees aren't taxed on their attendance fee, since that's a service - not a hard good. Most other items ARE taxable - if they're in Massachusetts (5%) or Canada (GST 5%). Is the a case where I need to modify the formulas.db to have a tax calc based on product category AND state OR country? If so, then I can't calculate the tax until I know the city and country they're purchasing from, so I need to get that information BEFORE I present the final invoice - which is not at all how the current Invoice.tmpl (again, from the General Store example) is set up.Ideas?I'm going to need to get a gigantic white board to keep track of all the branches of this decision tree - it's really beginning to get out of hand.Dan Keldsen - djk@delphigroup.com Director, I.S./Webmaster - webmaster@delphigroup.com Delphi Consulting Group, Inc. - http://www.delphigroup.com/ 100 City Hall Plaza - ph: 617-247-1511 Boston, MA 02108-2106 - fax:617-247-4957 Associated Messages, from the most recent to the oldest:

    
  1. Re: LOOP and IF statements (Kenneth Grome 1997)
  2. Re: LOOP and IF statements (Grant Hulbert 1997)
  3. Re: LOOP and IF statements (Kenneth Grome 1997)
  4. LOOP and IF statements (Dan Keldsen 1997)
I'm trying to do three things at the moment, that I can't quite figure out... some are probably quite simple, but then again...ONE, on the shopping cart page, I have the shipping options listed (WEB, UPS, FedEx) - and I want to only show the client/customer the available options to them at the moment. So, if they're NOT ordering something that is electronically deliverable, WEB shouldn't be an option.I'm thinking that I need to do a [loop][/loop] around a [showif][/showif] that parses [lineitems][/lineitems] to check to see if [canEmail] is T. After it determines that, build a pop-up menu (or radio button) to select the RELEVANT shipping method. Did I mention it shouldn't duplicate the available options? (finished list should NOT look like this: WEB, UPS, WEB, WEB, FedEx - but THIS: WEB, UPS, FedEx)I was trying the following snippet on the ShoppingCart.tmpl page from the General Store example:[lineitems] [showif [CanEmail]=]DELIVERABLE STATUS UNKNOWN
[/showif] [showif [CanEmail]=F]CANNOT BE DELIVERED ELECTRONICALLY
[/showif] [showif [CanEmail]=T]WEB DELIVERY
[/showif] [showif [category]=SEMINAR]Seminar - no delivery necessary
[/showif] [/lineItems]and does indeed do the showif, but I have the duplicated options problem I described above.TWO, Like some other folks, I'd like to be able to keep a database of rights/preferences for our web-enabled clients, so I can store their billing information (except for credit card # - or perhaps last 5 digits only), and their current access rights to various databases we plan on making available to PAID CLIENTS ONLY.For this, I need a few bits of information about the client: All Billing Info, client id (serial #, e-mail, username - possibilities), password, authorized areas, authorization begin date, authorization end date. So, if they're in the database, and enter the correct username and password, they can get access into whatever database we make available to them, as long as TODAY falls within their start and end dates.I understand that I probably need to do a [lookup] into a database that's storing all of this data, but I'm unsure how to proceed beyond that (like the other fellow on the list).Addendum - of course, I need to get the start/end date and area information into the above mentioned database as well, and it would be best if the final purchase command could create or append their current purchases to make instant gratification possible... otherwise, it would have to wait until I (or someone I train) gets the e-mail notification that a client's privileges have changed. This is a task I'm having a hard time visualizing in WebDNA. Any pointers?THREE, Taxes... Ugh. Some of our products/services are taxable, some aren't. For example, Seminar attendees aren't taxed on their attendance fee, since that's a service - not a hard good. Most other items ARE taxable - if they're in Massachusetts (5%) or Canada (GST 5%). Is the a case where I need to modify the formulas.db to have a tax calc based on product category AND state OR country? If so, then I can't calculate the tax until I know the city and country they're purchasing from, so I need to get that information BEFORE I present the final invoice - which is not at all how the current Invoice.tmpl (again, from the General Store example) is set up.Ideas?I'm going to need to get a gigantic white board to keep track of all the branches of this decision tree - it's really beginning to get out of hand.Dan Keldsen - djk@delphigroup.com Director, I.S./Webmaster - webmaster@delphigroup.com Delphi Consulting Group, Inc. - http://www.delphigroup.com/ 100 City Hall Plaza - ph: 617-247-1511 Boston, MA 02108-2106 - fax:617-247-4957 Dan Keldsen

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:

[delete] problem (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) Two options to consider (2008) WebCommerce: Folder organization ? (1997) Re:Subject: Mail Server Software (1998) webcatalog 2.1.3 ACGI Weirdness? (1998) Feature Request: DB Field manipulation (1998) [WebDNA] Intranet site request (2010) database size? (1997) auto-stripping of spaces (1997) [shownext max=?] armed (1997) [WebDNA] CSS Advice (2008) Mime-Version in email header (1997) Loosing Quantity (2000) HELP! 10K hits per hour for pages that no longer exist! (2000) Server slowing down. (1997) WebCat2 several catalogs? (1997) PCS Emailer's role ? (1997) Search/sort in URL Was: GuestBook example (1997) RAM crash (1998)