[ic] (no subject)
Kevin Walsh
kevin at cursor.biz
Thu Jul 7 11:42:02 EDT 2005
JT Justman [jt at airdelights.com] wrote:
> Michael wrote:
> > I am trying to have a payment option show up when there is a
> > zero balance,
> >
> > [if explicit]
> > [condition]
> > $test = [total-cost];
> > return 1 if $test eq "$0.00" ;
> > return 0;
> > [/condition]
> >
> > [if variable CHECK_ACCEPTED]
> > <option [selected mv_free] value="Free">[L]Free[/L]
> > [/if]
> > [/if]
> >
> Try putting $0.00 in single quotes. Double quotes cause perl to
> interpolate variables, thus the contents of the variable $0 concatinated
> with '.00' are being compared.
>
That can all be avoided with the use of [total-cost noformat=1], which
would return the value without a currency symbol. You could then just
use "return 1 unless $test;" in the [condition].
The CHECK_ACCEPTED test can also be done in the [condition] for added
efficiency: return 1 if (!$test && $Variable->{CHECK_ACCEPTED});
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
More information about the interchange-users
mailing list