I've just started to create a function that will use two variables on a website. The first variable is the combined weight of an order and the second is three ship rates. I am using a plugin that gives me these rates but doesn't allow me the option to only show the appropriate rate during checkout. This function would hopefully only display the correct option based on the weight variable.
In the code below I'm trying to say if weight <= 2 then show A, if weight => 3 but < 5 show B, else show C
<?php
function calculateWeightFlag($weight)
{
if($weight <=2)
{
setWeightFlagA();
}
elseif($weight =>3 || $weight <5)
{
setWeightFlagB();
}
else
{
setWeightFlagC();
}
}
?>
The syntax error starts on "elseif" line.