Code: Select all
$handling = MODULE_SHIPPING_USPS_HANDLING;
$cost_handling = $handling < 0 ? $cost + ($handling * $cost) : $cost + $handling;
I've tried casting it as floatval(MODULE_SHIPPING_USPS_HANDLING), (float)MODULE_SHIPPING_USPS_HANDLING, adding a float to it, and many others but to no avail. The code acts as if it's a string (I think) and $cost_handling always evaluates to the false side of the operator ($handling is added correctly to $cost to produce a decimal value).
What am I doing wrong?