[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: bug in [item-discount] and workaround
Quoting Brian Bullen (b.m.bullen@stir.ac.uk):
>
> [item-discount] appears to return the difference between
> the price for a single item and the discount-price for the quantity
> currently ordered - whereas I think the intention is
>
> quantity ordered times the normal price
> minus
> discount-price for that number of items
>
> My workaround is to avoid using item-discount and to use this:
>
> [currency][calc][item-quantity] * [item-price noformat] -
> [discount-price noformat][/calc][/currency]
>
>
> Note: I dont have separateitems set - the problem only arises
> if the quantity is > 1 for a given item in the cart.
> Brian.
> PS
> The fixed expression in Interpolate.pm :
>
> sub item_discount {
> my($code,$price,$q) = @_;
> return ($q * $price) - discount_price($code,$price,$q);
> }
>
Thanks for the fix, Brian. As usual, you are correct. 8-)
It is in the codebase and will be in 3.15.
--
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
131 Willow Lane, Floor 2 | || _ \
It's a little-known fact Oxford, OH 45056 | || |_) |
that the Y1K problem caused <mikeh@minivend.com> |___| _ <
the Dark Ages. -- unknown 513.523.7621 FAX 7501 |_| \_\