[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ic] (no subject)


JT Justman suppressed 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
 _/ _/    _/          _/ _/     _/    _/  _/_/    suppressed
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.