I need a simple code for the following code, may be a (for loop) or (an array) or (a simple if else) can accomplish this task, but I don't know how to do that.
$tax1 is related to $discount1.
$tax2 is related to $discount2.
$tax3 is related to $discount3.
Please help me. Thanks in advance.
Expand|Select|Wrap|Line Numbers
- if ($discount1 == 100 && $discount2 == 100 && $discount3 == 100)
- $total_price = $price - $tax1 - $tax2 - $tax3
- elseif ($discount2 == 100 && $discount3 == 100)
- $total_price = $price - $tax2 - $tax3
- elseif ($discount1 == 100 && $discount3 == 100)
- $total_price = $price - $tax1 - $tax3
- elseif ($discount1 == 100 && $discount2 == 100)
- $total_price = $price - $tax1 - $tax2
- elseif ($discount1 == 100)
- $total_price = $price - $tax1
- elseif ($discount2 == 100)
- $total_price = $price - $tax2
- elseif ($discount3 == 100)
- $total_price = $price - $tax3
- else
- $total_price = $price