So you have a price of £100.00.
At the first stage the reduction might be 50%.
Then the second stage takes that value and deducts a further 20%.
Example: 100.00 - 50%. 50.00.
50.00 - 20% = 10.00.
I cannot seem to work out the best way to do this.
Here it is so far.
Code: Select all
$result = mysql_query ("SELECT * FROM products WHERE id = '$id'");
while ($row = mysql_fetch_object($result))
{
$value = $row->rrp;
$rrp = $row->rrp;
} mysql_free_result($result);
if ($age == "0-1") { $value = $value / 100 * 50;
$value = $rrp - $value;}
if ($age == "1-2") { $value = $value / 100 * 55;
$value = $rrp - $value;}
if ($age == "2-3") { $value = $value / 100 * 60;
$value = $rrp - $value;}
if ($age == "3-4") { $value = $value / 100 * 65;
$value = $rrp - $value;}
if ($age == "4+") { $value = $value / 100 * 70;
$value = $rrp - $value;}
}
echo "Age: $value";
if ($condition == "good")
{
$value = $value / 100 * 20;
echo "$value";
}
echo "Conditon: $value";
}
Simon