I am calculating discounts based on a quantity after 6.
Is there a cleaner way to do this:
$leg_directory_discount = array(
6 => .50,
7 => .50,
8 => .50,
9 => .50,
10 => .50,
11 => 1,
12 => 1,
13 => 1,
14 => 1,
15 => 1,
16 => 1,
17 => 1,
18 => 1,
19 => 1,
20 => 1,
21 => 1.5,
22 => 1.5,
23 => 1.5,
24 => 1.5,
25 => 1.5,
26 => 1.5,
27 => 1.5,
28 => 1.5,
29 => 1.5,
30 => 1.5,
31 => 1.5,
32 => 1.5,
33 => 1.5,
34 => 1.5,
35 => 1.5,
36 => 1.5,
37 => 1.5,
38 => 1.5,
);
edit: The max and min values of the discounts never change. Here is how I'm calculating the discount and arriving at the final price:
if($v[0]['leg_discount'] == '1' && $v[0]['qty'] >= 6){
$discount = $qty * $leg_directory_discount[$qty];
$price = $price - $discount;
}