[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Perl interpolate question
>My code (in my flypage) is driving me nuts. :-)
>
>It's supposed to return the HTML that is defined in the variable $output at
>the beginning, if none of the IF/ELSIF conditions are net. But, when
>conditions aren't met, it returns nothing! (When conditions *are* met, the
>script works like a peach.
>I'm very grateful for anyone who will point out to me my dumb mistakes. I
>wonder if I'm not accomodating the manner in which MiniVend interpolates?
>TIA, Rob Maurer
>[perl interpolate=1]
>$output = '';
>
>$output .= qq(\n\t<td width="50%">) . qq([order [item-code]]);
>$output .= qq([Unable to display image][/order]</td>);
>$output .= qq(\n\t<td width="50%">) . qq([order [item-code]]) . qq([Unable
>to display image]) . qq([/order]) . qq(</td>);
>if ((qq([item-field limited]) eq "yes") && ([item-field availablenum] < 1)) {
> $output = '';
>$output .= qq(<td width="50%"><center><strong>);
> $output .= qq();
> $output .= qq(Not available.</strong></center></td>);
> $output .= qq(<td width="50%"><center><strong>);
> $output .= qq();
> $output .= qq(Item is sold.</strong></center></td>);
> }
>elsif (qq([item-field limited]) eq "yes") {
> $output .= qq(\n\t</tr><tr><td width="100%" colspan="2">);
> $output .= qq(<center><strong>);
> $output .= "Only " . "[item-field availablenum]" . " available!";
> $output .= qq(</strong></center></td>);
> }
>return $output;
>[/perl]
I had exactly the same problem today, and I solved this using the
[if ...]
[and ....]
[and...]
tags
You can combine as many conditions as you wish, and it works better than
Perl code