Copy link to clipboard
Copied
I have this calculation: <?php echo $subTotal + $shipTotal; ?>
where $shipTotal should be 50 if $shipTotal is more or the same as 50.
This is what I have found out so far:
<?php
if ($shipTotal < 50) {
echo $shipTotal;
} elseif ($shipTotal >= 50) {
echo "50";
}
?>
But I don't know how to put it in the calculation (so that $shipTotal is not getting more than 50).
Thankx for any further help and tips.
You're nearly there.
<?php
if ($shipTotal >= 50) {
$shipTotal = 50;
}echo $subTotal + $shipTotal;
?>
Copy link to clipboard
Copied
You're nearly there.
<?php
if ($shipTotal >= 50) {
$shipTotal = 50;
}echo $subTotal + $shipTotal;
?>