Skip to content

Commit

Permalink
minor cleanup; getting ready to switch to UpsAPI lib
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Jan 12, 2010
1 parent a6ae96d commit c1677b1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions upload/catalog/model/shipping/ups.php
@@ -1,18 +1,28 @@
<?php

require_once DIR_SYSTEM . "/external/ups/UpsAPI.php";
require_once DIR_SYSTEM . "/external/ups/UpsAPI/Client.php";
require_once DIR_SYSTEM . "/external/ups/UpsAPI/RatesAndService.php";
require_once DIR_SYSTEM . "/external/ups/UpsAPI/Tracking.php";

class ModelShippingUps extends Model {
function getQuote($country_id, $zone_id, $postcode = '') {
$this->load->language('shipping/ups');

if ($this->config->get('ups_status')) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int)$this->config->get('ups_geo_zone_id') . "' AND country_id = '" . (int)$country_id . "' AND (zone_id = '" . (int)$zone_id . "' OR zone_id = '0')");

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone " .
"WHERE geo_zone_id = '" . (int)$this->config->get('ups_geo_zone_id') . "'" .
"AND country_id = '" . (int)$country_id . "'" .
"AND (zone_id = '" . (int)$zone_id . "'" .
"OR zone_id = '0')");

if (!$this->config->get('ups_geo_zone_id')) {
$status = TRUE;
} elseif ($query->num_rows) {
if (!$this->config->get('ups_geo_zone_id') || $query->num_rows) {
$status = TRUE;
} else {
$status = FALSE;
}

} else {
$status = FALSE;
}
Expand Down

0 comments on commit c1677b1

Please sign in to comment.