@$totalCost += ($row["qty"] * $row["itemPrice"]); @$totalCost = $totalCost + ($row["qty"] * $row["itemPrice"]); $shipping = $totalCost; echo $shipping; if($shipping < 100.00 && $shipping > 0.01){ //if great then 100 add the following $shipping = $shipping + 5.95; }elseif ($shipping > 100.00 && $shipping < 200.00){ //if between 100 - 200 add the following value $shipping = $shipping + 10.00; }elseif ($shipping > 300.00){ $shipping += 10 + floor(($shipping - 200) / 100); } $shipping = number_format($shipping, 2, ".", ","); $shippingtotal = number_format($totalCost,2,".",","); $shippingtotal = $shipping - $shippingtotal; $tax = 0.06 * $totalCost;