Annotated File View
hpdl
|
620
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: table.php 440 2006-02-19 18:40:20Z hpdl $
|
|
4
|
|
|
5
|
osCommerce, Open Source E-Commerce Solutions
|
|
6
|
http://www.oscommerce.com
|
|
7
|
|
|
8
|
Copyright (c) 2006 osCommerce
|
|
9
|
|
|
10
|
Released under the GNU General Public License
|
|
11
|
*/
|
|
12
|
|
|
13
|
class osC_Shipping_table extends osC_Shipping_Admin {
|
|
14
|
var $icon;
|
|
15
|
|
|
16
|
var $_title,
|
|
17
|
$_code = 'table',
|
|
18
|
$_author_name = 'osCommerce',
|
|
19
|
$_author_www = 'http://www.oscommerce.com',
|
|
20
|
$_status = false,
|
|
21
|
$_sort_order;
|
|
22
|
|
|
23
|
// class constructor
|
|
24
|
function osC_Shipping_table() {
|
|
25
|
global $osC_Language;
|
|
26
|
|
|
27
|
$this->icon = '';
|
|
28
|
|
|
29
|
$this->_title = $osC_Language->get('shipping_table_title');
|
|
30
|
$this->_description = $osC_Language->get('shipping_table_description');
|
|
31
|
$this->_status = (defined('MODULE_SHIPPING_TABLE_STATUS') && (MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
|
|
32
|
$this->_sort_order = (defined('MODULE_SHIPPING_TABLE_SORT_ORDER') ? MODULE_SHIPPING_TABLE_SORT_ORDER : null);
|
|
33
|
}
|
|
34
|
|
|
35
|
// class methods
|
|
36
|
function isInstalled() {
|
|
37
|
return (bool)defined('MODULE_SHIPPING_TABLE_STATUS');
|
|
38
|
}
|
|
39
|
|
|
40
|
function install() {
|
|
41
|
global $osC_Database;
|
|
42
|
|
|
43
|
parent::install();
|
|
44
|
|
hpdl
|
758
|
45
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_TABLE_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'osc_cfg_set_boolean_value(array(\'True\', \'False\'))', now())");
|
hpdl
|
620
|
46
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_TABLE_COST', '25:8.50,50:5.50,10000:0.00', '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', '6', '0', now())");
|
hpdl
|
758
|
47
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_TABLE_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'osc_cfg_set_boolean_value(array(\'weight\', \'price\'))', now())");
|
hpdl
|
620
|
48
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TABLE_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
|
hpdl
|
758
|
49
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_TABLE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'osc_cfg_use_get_tax_class_title', 'osc_cfg_set_tax_classes_pull_down_menu', now())");
|
|
50
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_TABLE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'osc_cfg_use_get_zone_class_title', 'osc_cfg_set_zone_classes_pull_down_menu', now())");
|
hpdl
|
620
|
51
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_TABLE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
|
hpdl
|
758
|
52
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Module weight Unit', 'MODULE_SHIPPING_TABLE_WEIGHT_UNIT', '2', 'What unit of weight does this shipping module use?.', '6', '0', 'osC_Weight::getTitle', 'osc_cfg_set_weight_classes_pulldown_menu', now())");
|
hpdl
|
620
|
53
|
}
|
|
54
|
|
|
55
|
function getKeys() {
|
|
56
|
if (!isset($this->_keys)) {
|
|
57
|
$this->_keys = array('MODULE_SHIPPING_TABLE_STATUS',
|
|
58
|
'MODULE_SHIPPING_TABLE_COST',
|
|
59
|
'MODULE_SHIPPING_TABLE_MODE',
|
|
60
|
'MODULE_SHIPPING_TABLE_HANDLING',
|
|
61
|
'MODULE_SHIPPING_TABLE_TAX_CLASS',
|
|
62
|
'MODULE_SHIPPING_TABLE_ZONE',
|
|
63
|
'MODULE_SHIPPING_TABLE_SORT_ORDER',
|
|
64
|
'MODULE_SHIPPING_TABLE_WEIGHT_UNIT');
|
|
65
|
}
|
|
66
|
|
|
67
|
return $this->_keys;
|
|
68
|
}
|
|
69
|
}
|
|
70
|
?>
|
|