Met een selecteer menu verder laten berekenen.
Als ik "Bezorgen" selecteer totaal product + 10%.
Als ik "Creditcard" selecteer totaal product + 5%.
Als ik allebei selecteer "Bezorgen" en "Creditcard"
totaal = (totaal product + 10%) + ((totaal product + 10%)+ 5%)
En deze script toon bij "te betalen" € .. €..
Is er iemand die mij kan helpen?
Alvast bedankt
Als ik "Bezorgen" selecteer totaal product + 10%.
Als ik "Creditcard" selecteer totaal product + 5%.
Als ik allebei selecteer "Bezorgen" en "Creditcard"
totaal = (totaal product + 10%) + ((totaal product + 10%)+ 5%)
PHP:
if ($type_service == "Bezorgen"){
$totaal = round($totaal_product + ($totaal_product * 0.10));
} else {
$totaal = $totaal_product;
}
if ($betalingsmethode == "Creditcard"){
$totaal = round($totaal_product + ($totaal_product * 0.05));
} else {
$totaal = $totaal_product;
}
En deze script toon bij "te betalen" € .. €..
PHP:
<tabel>
<tr>
<td>Te betalen</td><td>:</td>
<td>
<?php
if ($type_service == "Bezorgen"){
$totaal = round($totaal_product + ($totaal_product * 0.10));
echo "<b>€ ".($totaal)."</b>";
} else {
echo "<b>€ ".($totaal_product)."</b>";
}
if ($betalingsmethode == "Creditcard"){
$totaal = round($totaal_product + ($totaal_product * 0.05));
echo "<b>€ ".($totaal)."</b>";
} else {
echo "<b>€ ".($totaal_product)."</b>";
}
?>
</td>
</tr>
</table>
Is er iemand die mij kan helpen?
Alvast bedankt