UPDATE
I tried your suggestion Loren but I had no luck. I think the reason is the
IF tag doesn't know how to compare a number. I can only compare a string. I
am guessing this because the help files say that QuantityOnHand displays the
number it contains. Therefore I can check if there is a number using [-- IF
PRODUCT.QuantityOnHand --] but I can't compare the value.
I did find a solution for anyone who's interested though. I used javascript
instead:
<script language="JavaScript">
var outstock = "<HTML>";
var instock = "<HTML>";
var Quantity = [-- PRODUCT.QuantityOnHand --];
if(Quantity == 0) {
document.write(outstock);
} else {
document.write(instock);
}
</script>
where outstock is a variable that contains the HTML string I want for and
out of stock product and instock is the HTML for an instock product.
"Loren" <loren_d_c@yahoo.com> wrote in message
news:3E557804.A0C61998@yahoo.com...
Try:
[-- IF PRODUCT.QuantityOnHand "0" --]
I think that if the value you are trying to compare is the actual contents
of
the field, then it should be surrounded by quotes like that. Of course a
VAR or
some other template tag would not need to be in quotes.
-Loren
Andrew G wrote:
I am trying to use the IF tags for a custom 'more info' page that shows
when
a product is out of stock by checking the QuanityOnHand value for 0.
Using
the code below it always uses the html in the [-- ELSE --] tag even if i
set
the QuantityOnHand to 0 for my test product. I 'think' im doing it
correctly
based on the Shopsite help docs... but they don't give examples. Here's
my
code:
[-- IF PRODUCT.QuantityOnHand 0 --]
html stuff
[-- ELSE --]
different HTML stuff
[-- END_IF --]
Am I using it right?
Thanks in advance for any insight!
Andrew G