From 2b878e1046a4e5030f84304f799928dc65403065 Mon Sep 17 00:00:00 2001 From: "Fred Dirkse - OIC Group, Inc" Date: Thu, 16 Jun 2011 12:59:06 -0500 Subject: [PATCH] Added default message and rate for tablebasedshipping --- .../shippingcalculators/tablebasedcalculator.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/framework/modules/ecommerce/shippingcalculators/tablebasedcalculator.php b/framework/modules/ecommerce/shippingcalculators/tablebasedcalculator.php index 83954a686d..c9638cb170 100755 --- a/framework/modules/ecommerce/shippingcalculators/tablebasedcalculator.php +++ b/framework/modules/ecommerce/shippingcalculators/tablebasedcalculator.php @@ -60,18 +60,20 @@ public function getRates($order) { //52 - PuertoRico $stateUpcharge = array('2','21','52'); - if(!empty($c)) { + $rates = array(); + if(!empty($c)) { for($i = 0; $i < count($c); $i++) { if (in_array($currentMethod->state, $stateUpcharge)) { $c[$i] += 1.50; $c[$i] += 1.50; } - $rates[0 . ($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]); + if($i <= 9) $rates[($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]); + else $rates[0 . ($i+1)] = array('id' => 0 . ($i+1), 'title' => $this->shippingspeeds[$i]->speed, 'cost' => $c[$i]); } } - + if(!count($rates)) $rates[01] = array('id' => 01, 'title' => "Table Based Shipping is Currently NOT Configured", 'cost' => 0); return $rates; }