[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Where's my syntax mistake? _VERY SMALL_ code section; won't takelong!
****** message to minivend-users from mediamob <mediamob@dnaco.net> ******
Greets all-
Final testing stopped once again due to a pesky problem that one of you
will probably spot at once, but which I just can't see.
The problem is this: I had no way to prevent an order being taken which
contained a Zip code of valid format but no postal validity - e.g. a zip
of 00000 would pass, but not be found in the ups lookup table and return a
[shipping] of $0.00.
Here's the code I tried to detect the $0.00 value, and thereby set a
session variable which could be tested in an order profile:
[if type=value term=shipping op="ne" compare="$0.00"]
[set name="shipamt" interpolate=1][shipping][/set]
Shipamt=[scratch shipamt]
[else]
[set name="shipamt"][/set]
Shipamt = Blank ([scratch shipamt])
[/else]
[/if]
This code does display on the page the value of shipamt the same as
[shipping] - but shipamt never goes blank, even when [shipping] shows up
as $0.00 on the page. I have also tried several alternate tests, e.g.:
[if type=value term=shipping op="!=" compare="0"]
With different, but still undesired, results.
Here's the code that checks for it:
[set checkout_profile]
name=required
address=required
city=required
country=required
state=state
zip=zip Not a US zip code
email=required
phone_day=phone
email=email
shipamt=required Shipping not vaild - check zip code and state.
&fatal = yes
As I read the docs, this should cause a failure if shipamt is blank - yet
we know from the first code fragment that one problem is that it NEVER
gets set blank. Nonetheless, orders fail and display the more info page.
What is it that I don't get?
thanks,
Pat
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list