[ic] Discounts

tom tom at acronpaints.co.uk
Mon Aug 16 11:36:59 EDT 2004


I'm sure this has been gone into at great length before, but I can't find
anything that answers my question in the archives.

This with with Interchange 5.0.0.

I would like orders over a certain group of values to be discounted, I have
tried the following (which does exactly what you'd expect it to.)

[discount ENTIRE_ORDER]
    if ($s < 75) {$dis = 0;$s}
    elsif ($s < 100) {$dis = $s * 0.1;$s*0.9;}
    elsif ($s < 450) {$dis = $s * 0.15;$s*0.85;}
    elsif ($s < 1000) {$dis = $s * 0.175;$s*0.825;}
    elsif ($s < 5000) {$dis = $s * 0.225;$s*0.775;}
    else {$dis = $s * 0.30;$s*0.70;}
[/discount]


This displays the basket as:

    Subtotal:   <discounted value>
    Vat: <at the value it would have been without the discount>
    Total: <Total of above>

This is with the code placed in either ord/checkout.html or
include/shopping_cart, irrespective of where it is placed in the code.

How do I get it to work out the correct sales tax? (is there some vaiable I
should be able to set alongsize $s?)

How can I change it so that the subtotal reads what it would read without a
discount added with a column underneath saying discount: <$dis>?

TIA for any help regarding this.



More information about the interchange-users mailing list