Code Duplication    Length = 31-31 lines in 3 locations

catalog/includes/modules/shipping/flat.php 1 location

@@ 17-47 (lines=31) @@
14
    var $code, $title, $description, $icon, $enabled;
15
16
// class constructor
17
    function __construct() {
18
      global $order;
19
20
      $OSCOM_Db = Registry::get('Db');
21
22
      $this->code = 'flat';
23
      $this->title = OSCOM::getDef('module_shipping_flat_text_title');
24
      $this->description = OSCOM::getDef('module_shipping_flat_text_description');
25
      $this->sort_order = defined('MODULE_SHIPPING_FLAT_SORT_ORDER') ? (int)MODULE_SHIPPING_FLAT_SORT_ORDER : 0;
26
      $this->icon = '';
27
      $this->tax_class = defined('MODULE_SHIPPING_FLAT_TAX_CLASS') ? MODULE_SHIPPING_FLAT_TAX_CLASS : 0;
28
      $this->enabled = (defined('MODULE_SHIPPING_FLAT_STATUS') && (MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
29
30
      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
31
        $check_flag = false;
32
        $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_FLAT_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id');
33
        while ($Qcheck->fetch()) {
34
          if ($Qcheck->valueInt('zone_id') < 1) {
35
            $check_flag = true;
36
            break;
37
          } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) {
38
            $check_flag = true;
39
            break;
40
          }
41
        }
42
43
        if ($check_flag == false) {
44
          $this->enabled = false;
45
        }
46
      }
47
    }
48
49
// class methods
50
    function quote($method = '') {

catalog/includes/modules/shipping/item.php 1 location

@@ 17-47 (lines=31) @@
14
    var $code, $title, $description, $icon, $enabled;
15
16
// class constructor
17
    function __construct() {
18
      global $order;
19
20
      $OSCOM_Db = Registry::get('Db');
21
22
      $this->code = 'item';
23
      $this->title = OSCOM::getDef('module_shipping_item_text_title');
24
      $this->description = OSCOM::getDef('module_shipping_item_text_description');
25
      $this->sort_order = defined('MODULE_SHIPPING_ITEM_SORT_ORDER') ? (int)MODULE_SHIPPING_ITEM_SORT_ORDER : 0;
26
      $this->icon = '';
27
      $this->tax_class = defined('MODULE_SHIPPING_ITEM_TAX_CLASS') ? MODULE_SHIPPING_ITEM_TAX_CLASS : 0;
28
      $this->enabled = (defined('MODULE_SHIPPING_ITEM_STATUS') && (MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
29
30
      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
31
        $check_flag = false;
32
        $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_ITEM_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id');
33
        while ($Qcheck->fetch()) {
34
          if ($Qcheck->valueInt('zone_id') < 1) {
35
            $check_flag = true;
36
            break;
37
          } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) {
38
            $check_flag = true;
39
            break;
40
          }
41
        }
42
43
        if ($check_flag == false) {
44
          $this->enabled = false;
45
        }
46
      }
47
    }
48
49
// class methods
50
    function quote($method = '') {

catalog/includes/modules/shipping/table.php 1 location

@@ 17-47 (lines=31) @@
14
    var $code, $title, $description, $icon, $enabled;
15
16
// class constructor
17
    function __construct() {
18
      global $order;
19
20
      $OSCOM_Db = Registry::get('Db');
21
22
      $this->code = 'table';
23
      $this->title = OSCOM::getDef('module_shipping_table_text_title');
24
      $this->description = OSCOM::getDef('module_shipping_table_text_description');
25
      $this->sort_order = defined('MODULE_SHIPPING_TABLE_SORT_ORDER') ? (int)MODULE_SHIPPING_TABLE_SORT_ORDER : 0;
26
      $this->icon = '';
27
      $this->tax_class = defined('MODULE_SHIPPING_TABLE_TAX_CLASS') ? MODULE_SHIPPING_TABLE_TAX_CLASS : 0;
28
      $this->enabled = (defined('MODULE_SHIPPING_TABLE_STATUS') && (MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
29
30
      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
31
        $check_flag = false;
32
        $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_SHIPPING_TABLE_ZONE, 'zone_country_id' => $order->delivery['country']['id']], 'zone_id');
33
        while ($Qcheck->fetch()) {
34
          if ($Qcheck->valueInt('zone_id') < 1) {
35
            $check_flag = true;
36
            break;
37
          } elseif ($Qcheck->valueInt('zone_id') == $order->delivery['zone_id']) {
38
            $check_flag = true;
39
            break;
40
          }
41
        }
42
43
        if ($check_flag == false) {
44
          $this->enabled = false;
45
        }
46
      }
47
    }
48
49
// class methods
50
    function quote($method = '') {