Alright, I worked on this some (the == thing really solved a lot of mysteries. I can't believe I made that mistake!)
Here's what I have now:
if (get_orderinfo_shipping_field("state"))
$state= get_orderinfo_shipping_field("state");
else
$state= get_orderinfo_field("state");
$gesgewicht=0;
foreach ($basket_items as $i) {
//Weight calculated here.
$overall_weight+= item_get_field('weight', $i) * item_get_field('count', $i);
}
$fees["ON"] = array(15.15,19.90,25.60,30.50,34.10,38.45,42.80,47.95,52.85,56.50,61.15,66.65,71.15);
$fees["QC"] = array(15.15,19.90,25.60,30.50,34.10,38.45,42.80,47.95,52.85,56.50,61.15,66.65,71.15);
$fees["BC"] = array(22.55,31.35,37.70,42.75,46.95,52.05,57.10,62.55,68.45,72.60,78.05,83.05,88.05);
$fees["AB"] = array(22.55,31.35,37.70,42.75,46.95,52.05,57.10,62.55,68.45,72.60,78.05,83.05,88.05);
$fees["SK"] = array(22.55,31.35,37.70,42.75,46.95,52.05,57.10,62.55,68.45,72.60,78.05,83.05,88.05);
$fees["MB"] = array(22.55,31.35,37.70,42.75,46.95,52.05,57.10,62.55,68.45,72.60,78.05,83.05,88.05);
$fees["PE"] = array(22.60,34.45,41.40,44.40,49.95,57.30,62.00,66.85,70.45,75.45,81.65,87.65,93.65);
$fees["NB"] = array(22.60,34.45,41.40,44.40,49.95,57.30,62.00,66.85,70.45,75.45,81.65,87.65,93.65);
$fees["NL"] = array(22.60,34.45,41.40,44.40,49.95,57.30,62.00,66.85,70.45,75.45,81.65,87.65,93.65);
$fees["NS"] = array(22.60,34.45,41.40,44.40,49.95,57.30,62.00,66.85,70.45,75.45,81.65,87.65,93.65);
$feeIdx = floor($overall_weight/10);
if ($state=="ON" || $state=="QC") {
$shipping_fee = 0.55 * $overall_weight;
}
elseif ($state=="BC" || $state=="AB" || $state=="SK" || $state=="MB") {
$shipping_fee = 0.67 * $overall_weight;
}
elseif ($state=="PE" || $state=="NB" || $state=="NL" || $state=="NS") {
$shipping_fee = 0.73 * $overall_weight;
}
if ($feeIdx<count($fees[$state])) {
$shipping_fee = $fees[$state][$feeIdx];
}
$shipping_fee = $shipping_fee + 2;
That works pretty good so far, so I'm going to use that (and modify it) for all my shipping methods
Thanks a lot!