| @@ 63-142 (lines=80) @@ | ||
| 60 | return array('MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS', 'MODULE_ORDER_TOTAL_LOWORDERFEE_SORT_ORDER', 'MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE', 'MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER', 'MODULE_ORDER_TOTAL_LOWORDERFEE_FEE', 'MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION', 'MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS'); |
|
| 61 | } |
|
| 62 | ||
| 63 | function install() { |
|
| 64 | $OSCOM_Db = Registry::get('Db'); |
|
| 65 | ||
| 66 | $OSCOM_Db->save('configuration', [ |
|
| 67 | 'configuration_title' => 'Display Low Order Fee', |
|
| 68 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_STATUS', |
|
| 69 | 'configuration_value' => 'true', |
|
| 70 | 'configuration_description' => 'Do you want to display the low order fee?', |
|
| 71 | 'configuration_group_id' => '6', |
|
| 72 | 'sort_order' => '1', |
|
| 73 | 'set_function' => 'tep_cfg_select_option(array(\'true\', \'false\'), ', |
|
| 74 | 'date_added' => 'now()' |
|
| 75 | ]); |
|
| 76 | ||
| 77 | $OSCOM_Db->save('configuration', [ |
|
| 78 | 'configuration_title' => 'Sort Order', |
|
| 79 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_SORT_ORDER', |
|
| 80 | 'configuration_value' => '4', |
|
| 81 | 'configuration_description' => 'Sort order of display. Lowest is displayed first.', |
|
| 82 | 'configuration_group_id' => '6', |
|
| 83 | 'sort_order' => '0', |
|
| 84 | 'date_added' => 'now()' |
|
| 85 | ]); |
|
| 86 | ||
| 87 | $OSCOM_Db->save('configuration', [ |
|
| 88 | 'configuration_title' => 'Allow Low Order Fee', |
|
| 89 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE', |
|
| 90 | 'configuration_value' => 'false', |
|
| 91 | 'configuration_description' => 'Do you want to allow low order fees?', |
|
| 92 | 'configuration_group_id' => '6', |
|
| 93 | 'sort_order' => '1', |
|
| 94 | 'set_function' => 'tep_cfg_select_option(array(\'true\', \'false\'), ', |
|
| 95 | 'date_added' => 'now()' |
|
| 96 | ]); |
|
| 97 | ||
| 98 | $OSCOM_Db->save('configuration', [ |
|
| 99 | 'configuration_title' => 'Order Fee For Orders Under', |
|
| 100 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER', |
|
| 101 | 'configuration_value' => '50', |
|
| 102 | 'configuration_description' => 'Add the low order fee to orders under this amount.', |
|
| 103 | 'configuration_group_id' => '6', |
|
| 104 | 'sort_order' => '1', |
|
| 105 | 'use_function' => 'currencies->format', |
|
| 106 | 'date_added' => 'now()' |
|
| 107 | ]); |
|
| 108 | ||
| 109 | $OSCOM_Db->save('configuration', [ |
|
| 110 | 'configuration_title' => 'Order Fee', |
|
| 111 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_FEE', |
|
| 112 | 'configuration_value' => '5', |
|
| 113 | 'configuration_description' => 'Low order fee.', |
|
| 114 | 'configuration_group_id' => '6', |
|
| 115 | 'sort_order' => '1', |
|
| 116 | 'use_function' => 'currencies->format', |
|
| 117 | 'date_added' => 'now()' |
|
| 118 | ]); |
|
| 119 | ||
| 120 | $OSCOM_Db->save('configuration', [ |
|
| 121 | 'configuration_title' => 'Attach Low Order Fee On Orders Made', |
|
| 122 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION', |
|
| 123 | 'configuration_value' => 'both', |
|
| 124 | 'configuration_description' => 'Attach low order fee for orders sent to the set destination.', |
|
| 125 | 'configuration_group_id' => '6', |
|
| 126 | 'sort_order' => '1', |
|
| 127 | 'set_function' => 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', |
|
| 128 | 'date_added' => 'now()' |
|
| 129 | ]); |
|
| 130 | ||
| 131 | $OSCOM_Db->save('configuration', [ |
|
| 132 | 'configuration_title' => 'Tax Class', |
|
| 133 | 'configuration_key' => 'MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS', |
|
| 134 | 'configuration_value' => '0', |
|
| 135 | 'configuration_description' => 'Use the following tax class on the low order fee.', |
|
| 136 | 'configuration_group_id' => '6', |
|
| 137 | 'sort_order' => '1', |
|
| 138 | 'use_function' => 'tep_get_tax_class_title', |
|
| 139 | 'set_function' => 'tep_cfg_pull_down_tax_classes(', |
|
| 140 | 'date_added' => 'now()' |
|
| 141 | ]); |
|
| 142 | } |
|
| 143 | ||
| 144 | function remove() { |
|
| 145 | return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")'); |
|
| @@ 91-169 (lines=79) @@ | ||
| 88 | return defined('MODULE_SHIPPING_TABLE_STATUS'); |
|
| 89 | } |
|
| 90 | ||
| 91 | function install() { |
|
| 92 | $OSCOM_Db = Registry::get('Db'); |
|
| 93 | ||
| 94 | $OSCOM_Db->save('configuration', [ |
|
| 95 | 'configuration_title' => 'Enable Table Method', |
|
| 96 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_STATUS', |
|
| 97 | 'configuration_value' => 'True', |
|
| 98 | 'configuration_description' => 'Do you want to offer table rate shipping?', |
|
| 99 | 'configuration_group_id' => '6', |
|
| 100 | 'sort_order' => '1', |
|
| 101 | 'set_function' => 'tep_cfg_select_option(array(\'True\', \'False\'), ', |
|
| 102 | 'date_added' => 'now()' |
|
| 103 | ]); |
|
| 104 | ||
| 105 | $OSCOM_Db->save('configuration', [ |
|
| 106 | 'configuration_title' => 'Shipping Table', |
|
| 107 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_COST', |
|
| 108 | 'configuration_value' => '25:8.50,50:5.50,10000:0.00', |
|
| 109 | 'configuration_description' => 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', |
|
| 110 | 'configuration_group_id' => '6', |
|
| 111 | 'sort_order' => '1', |
|
| 112 | 'date_added' => 'now()' |
|
| 113 | ]); |
|
| 114 | ||
| 115 | $OSCOM_Db->save('configuration', [ |
|
| 116 | 'configuration_title' => 'Table Method', |
|
| 117 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_MODE', |
|
| 118 | 'configuration_value' => 'weight', |
|
| 119 | 'configuration_description' => 'The shipping cost is based on the order total or the total weight of the items ordered.', |
|
| 120 | 'configuration_group_id' => '6', |
|
| 121 | 'sort_order' => '1', |
|
| 122 | 'set_function' => 'tep_cfg_select_option(array(\'weight\', \'price\'), ', |
|
| 123 | 'date_added' => 'now()' |
|
| 124 | ]); |
|
| 125 | ||
| 126 | $OSCOM_Db->save('configuration', [ |
|
| 127 | 'configuration_title' => 'Handling Fee', |
|
| 128 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_HANDLING', |
|
| 129 | 'configuration_value' => '0', |
|
| 130 | 'configuration_description' => 'Handling fee for this shipping method.', |
|
| 131 | 'configuration_group_id' => '6', |
|
| 132 | 'sort_order' => '1', |
|
| 133 | 'date_added' => 'now()' |
|
| 134 | ]); |
|
| 135 | ||
| 136 | $OSCOM_Db->save('configuration', [ |
|
| 137 | 'configuration_title' => 'Tax Class', |
|
| 138 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_TAX_CLASS', |
|
| 139 | 'configuration_value' => '0', |
|
| 140 | 'configuration_description' => 'Use the following tax class on the shipping fee.', |
|
| 141 | 'configuration_group_id' => '6', |
|
| 142 | 'sort_order' => '1', |
|
| 143 | 'use_function' => 'tep_get_tax_class_title', |
|
| 144 | 'set_function' => 'tep_cfg_pull_down_tax_classes(', |
|
| 145 | 'date_added' => 'now()' |
|
| 146 | ]); |
|
| 147 | ||
| 148 | $OSCOM_Db->save('configuration', [ |
|
| 149 | 'configuration_title' => 'Shipping Zone', |
|
| 150 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_ZONE', |
|
| 151 | 'configuration_value' => '0', |
|
| 152 | 'configuration_description' => 'If a zone is selected, only enable this shipping method for that zone.', |
|
| 153 | 'configuration_group_id' => '6', |
|
| 154 | 'sort_order' => '1', |
|
| 155 | 'use_function' => 'tep_get_zone_class_title', |
|
| 156 | 'set_function' => 'tep_cfg_pull_down_zone_classes(', |
|
| 157 | 'date_added' => 'now()' |
|
| 158 | ]); |
|
| 159 | ||
| 160 | $OSCOM_Db->save('configuration', [ |
|
| 161 | 'configuration_title' => 'Sort Order', |
|
| 162 | 'configuration_key' => 'MODULE_SHIPPING_TABLE_SORT_ORDER', |
|
| 163 | 'configuration_value' => '0', |
|
| 164 | 'configuration_description' => 'Sort order of display. Lowest is displayed first.', |
|
| 165 | 'configuration_group_id' => '6', |
|
| 166 | 'sort_order' => '0', |
|
| 167 | 'date_added' => 'now()' |
|
| 168 | ]); |
|
| 169 | } |
|
| 170 | ||
| 171 | function remove() { |
|
| 172 | return Registry::get('Db')->exec('delete from :table_configuration where configuration_key in ("' . implode('", "', $this->keys()) . '")'); |
|