Your not reading all the code required.
PHP Code:
// First get the dest zip and check the db for our dest zone
$topcode = $order->delivery['postcode'];
if ( $topcode == '' ){
// Something is wrong, we didn't find any dest zip
$this->quotes['error'] = MODULE_SHIPPING_FASTWAY_NO_POSTCODE_FOUND;
return $this->quotes;
}
// This section has been modified so that the delivery days will display as expected.
//The original code is still shown for reference.
//
//$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
//$rec = $db->Execute($sql);
//
// if ($rec->fields['f_delivery'] = 'S/D') {
// $days = 'same';
// }
// if ($rec->fields['f_delivery'] = 'N/D') {
// $days = 'next';
// } else {
// $days = $rec['f_delivery'];
//}
//
$sql = "SELECT * FROM " . DB_PREFIX . "fastway_zones WHERE $topcode >= f_postcode and $topcode <= f_postcode";
$rec = $db->Execute($sql);
if ($rec->fields['f_delivery'] == '') {
$days = 'unknown';
}
if ($rec->fields['f_delivery'] == 'S/D') {
$days = 'same';
}
if ($rec->fields['f_delivery'] == 'N/D') {
$days = 'next';
}
else {
$days = ($rec->fields['f_delivery']);
}
if ($rec->fields['f_zone'] == '1') {
$shipping = -1;
$dest_zone = 1;
$zones_cost = constant('MODULE_SHIPPING_ZONE_1_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_1_HANDLING');
}
elseif ($rec->fields['f_zone'] == '2') {
$shipping = -1;
$dest_zone = 2;
$zones_cost = constant('MODULE_SHIPPING_ZONE_2_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_2_HANDLING');
}
elseif ($rec->fields['f_zone'] == '3') {
$shipping = -1;
$dest_zone = 3;
$zones_cost = constant('MODULE_SHIPPING_ZONE_3_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_3_HANDLING');
}
elseif ($rec->fields['f_zone'] == '4') {;
$shipping = -1;
$dest_zone = 4;
$zones_cost = constant('MODULE_SHIPPING_ZONE_4_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_4_HANDLING');
}
elseif ($rec->fields['f_zone'] == 'L') {
$shipping = -1;
$dest_zone = 5;
$zones_cost = constant('MODULE_SHIPPING_ZONE_LOCAL_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_LOCAL_HANDLING');
}
elseif ($rec->fields['f_zone'] == 'S/H') {
$shipping = -1;
$dest_zone = 6;
$zones_cost = constant('MODULE_SHIPPING_ZONE_SHORT_COST');
$zones_handling = constant('MODULE_SHIPPING_ZONE_SHORT_HANDLING');
} else {
// Something is wrong, we didn't find any zone
$this->quotes['error'] = MODULE_SHIPPING_FASTWAY_NO_ZONE_FOUND;
return $this->quotes;
}
You will note that I have modified part of my code so that the delivery days tests and displays properly. This may be your problem.
Regards
Fred
Bookmarks