[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] 3.12 Discount on Order Subtotal
****** message to minivend-users from jojo@buchonline.net ******
On 3 Mar, Charlie Blanchard wrote:
> ****** message to minivend-users from Charlie Blanchard <charlie@blanchardsite.com> ******
>
> Hello,
>
> I have been running several Minivend catalogs for awhile now.
> However, a client has asked to be able to offer discounts based
> on the order subtotal. (25% if > $499; 20% if > $349 etc)
>
> Seems this should be do-able. Using a development base of RH6.0
> Linux and Perl v5.005_03 the following do not produce the desired
> results:
>
> [discount ALL_ITEMS]
> return ($s * .75) if $s > 499.99;
> return ($s * .8) if $s > 349.99;
> return ($s * .85) if $s > 249.99;
> return ($s * .9);
> [/discount]
[DEL]
> None of these variations on the if statements work, they all
> simply do the return that has no if test.
>
> Please forgive me if this has already been 'beaten to death' but
> I can't find this particular wrinkle anywhere in the mail
> archives and the variations I'm using above came from the
> Minivend docs sooo...
>
> Any pointers (or solutions<g>) would be very welcome!
>
> TIA
>
> -cb
Try (for example)
[discount ALL_ITEMS]
return ($s * .75) if [subtotal noformat=1] > 499.99;
return ($s * .8) if [subtotal noformat=1] > 349.99;
return ($s * .85) if [subtotal noformat=1] > 249.99;
return ($s * .9);
[/discount]
or
[set name="test" ....][subtotal noformat=1][/set]
and
[perl arg=scratch]
any perl stuff like if ($Safe(scratch)->(test) > 499.99) ....
[/perl]
I´m not sure about the right syntax of [set...] (i write this email
during my holiday and not from my own machine).
Hmmm...maybe you get failure with all your codes, because you have
forgotten to use "noformat=1"? With perl, you get 0 (NULL/ZERO) always,
if there are any chars ($, DM, EUR, FR, etc.).
Regards,
Joachim
-
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