[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Need some help doing an if compare on price
****** message to minivend-users from Mike Heins <mikeh@minivend.com> ******
Quoting Heinz Wittenbecher (heinz@bytedesigns.com):
>
> on 05/22/00 8:42 AM, Christopher Thompson at ct@arborinternet.com wrote:
>
> > ****** message to minivend-users from "Christopher Thompson"
> > <ct@arborinternet.com> ******
> >
> > I believe it would be something like (check the docs):
> >
> > [if-item price]
> > ..
Since [item-price] is not a database value nor a variable value,
there is not direct accessor.
(By the way, this is one of the most common errors I see on
the list. You can't just invent things like [if item-price > 0],
but people seem to think you ought to. I don't quite know what
to do about this; suggestions are welcome.)
Usually, with price the problem is two-fold:
1. Value may be 0.00, which is true to Perl, so
[if-field price] will not work even if you are using
just simple pricing.
2. If using the output of the [item-price] tag, currency
formatting can mess you up.
Here is the canonical way:
[if type=explicit compare="[calc][item-price noformat=1] > 0[/calc]"]
...
[/if]
You can use backticks, i.e. `[item-price noformat=1] > 0`
works instead.
--
Internet Robotics, 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <mikeh@minivend.com>
My wife is great. She doesn't care where I go, just as long as I don't
have any fun. -- Lee Trevino
-
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