Code Duplication    Length = 57-58 lines in 2 locations

catalog/includes/modules/order_total/ot_shipping.php 1 location

@@ 76-132 (lines=57) @@
73
      return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');
74
    }
75
76
    function install() {
77
      $OSCOM_Db = Registry::get('Db');
78
79
      $OSCOM_Db->save('configuration', [
80
        'configuration_title' => 'Display Shipping',
81
        'configuration_key' => 'MODULE_ORDER_TOTAL_SHIPPING_STATUS',
82
        'configuration_value' => 'true',
83
        'configuration_description' => 'Do you want to display the order shipping cost?',
84
        'configuration_group_id' => '6',
85
        'sort_order' => '1',
86
        'set_function' => 'tep_cfg_select_option(array(\'true\', \'false\'), ',
87
        'date_added' => 'now()'
88
      ]);
89
90
      $OSCOM_Db->save('configuration', [
91
        'configuration_title' => 'Sort Order',
92
        'configuration_key' => 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER',
93
        'configuration_value' => '2',
94
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
95
        'configuration_group_id' => '6',
96
        'sort_order' => '0',
97
        'date_added' => 'now()'
98
      ]);
99
100
      $OSCOM_Db->save('configuration', [
101
        'configuration_title' => 'Allow Free Shipping',
102
        'configuration_key' => 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING',
103
        'configuration_value' => 'false',
104
        'configuration_description' => 'Do you want to allow free shipping?',
105
        'configuration_group_id' => '6',
106
        'sort_order' => '1',
107
        'set_function' => 'tep_cfg_select_option(array(\'true\', \'false\'), ',
108
        'date_added' => 'now()'
109
      ]);
110
111
      $OSCOM_Db->save('configuration', [
112
        'configuration_title' => 'Free Shipping For Orders Over',
113
        'configuration_key' => 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER',
114
        'configuration_value' => '50',
115
        'configuration_description' => 'Provide free shipping for orders over the set amount.',
116
        'configuration_group_id' => '6',
117
        'sort_order' => '1',
118
        'use_function' => 'currencies->format',
119
        'date_added' => 'now()'
120
      ]);
121
122
      $OSCOM_Db->save('configuration', [
123
        'configuration_title' => 'Provide Free Shipping For Orders Made',
124
        'configuration_key' => 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION',
125
        'configuration_value' => 'national',
126
        'configuration_description' => 'Provide free shipping for orders sent to the set destination.',
127
        'configuration_group_id' => '6',
128
        'sort_order' => '1',
129
        'set_function' => 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ',
130
        'date_added' => 'now()'
131
      ]);
132
    }
133
134
    function remove() {
135
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');

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

@@ 72-129 (lines=58) @@
69
      return defined('MODULE_SHIPPING_FLAT_STATUS');
70
    }
71
72
    function install() {
73
      $OSCOM_Db = Registry::get('Db');
74
75
      $OSCOM_Db->save('configuration', [
76
        'configuration_title' => 'Enable Flat Shipping',
77
        'configuration_key' => 'MODULE_SHIPPING_FLAT_STATUS',
78
        'configuration_value' => 'True',
79
        'configuration_description' => 'Do you want to offer flat rate shipping?',
80
        'configuration_group_id' => '6',
81
        'sort_order' => '1',
82
        'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ',
83
        'date_added' => 'now()'
84
      ]);
85
86
      $OSCOM_Db->save('configuration', [
87
        'configuration_title' => 'Shipping Cost',
88
        'configuration_key' => 'MODULE_SHIPPING_FLAT_COST',
89
        'configuration_value' => '5.00',
90
        'configuration_description' => 'The shipping cost for all orders using this shipping method.',
91
        'configuration_group_id' => '6',
92
        'sort_order' => '1',
93
        'date_added' => 'now()'
94
      ]);
95
96
      $OSCOM_Db->save('configuration', [
97
        'configuration_title' => 'Tax Class',
98
        'configuration_key' => 'MODULE_SHIPPING_FLAT_TAX_CLASS',
99
        'configuration_value' => '0',
100
        'configuration_description' => 'Use the following tax class on the shipping fee.',
101
        'configuration_group_id' => '6',
102
        'sort_order' => '1',
103
        'use_function' => 'tep_get_tax_class_title',
104
        'set_function' => 'tep_cfg_pull_down_tax_classes(',
105
        'date_added' => 'now()'
106
      ]);
107
108
      $OSCOM_Db->save('configuration', [
109
        'configuration_title' => 'Shipping Zone',
110
        'configuration_key' => 'MODULE_SHIPPING_FLAT_ZONE',
111
        'configuration_value' => '0',
112
        'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.',
113
        'configuration_group_id' => '6',
114
        'sort_order' => '1',
115
        'use_function' => 'tep_get_zone_class_title',
116
        'set_function' => 'tep_cfg_pull_down_zone_classes(',
117
        'date_added' => 'now()'
118
      ]);
119
120
      $OSCOM_Db->save('configuration', [
121
        'configuration_title' => 'Sort Order',
122
        'configuration_key' => 'MODULE_SHIPPING_FLAT_SORT_ORDER',
123
        'configuration_value' => '0',
124
        'configuration_description' => 'Sort order of display. Lowest is displayed first.',
125
        'configuration_group_id' => '6',
126
        'sort_order' => '0',
127
        'date_added' => 'now()'
128
      ]);
129
    }
130
131
    function remove() {
132
      return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")');