Annotated File View
hpdl
|
620
|
1
|
<?php
|
|
2
|
/*
|
|
3
|
$Id: flat.php 421 2006-02-08 17:53:17Z 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_free extends osC_Shipping_Admin {
|
|
14
|
var $icon;
|
|
15
|
|
|
16
|
var $_title,
|
|
17
|
$_code = 'free',
|
|
18
|
$_author_name = 'osCommerce',
|
|
19
|
$_author_www = 'http://www.oscommerce.com',
|
hpdl
|
855
|
20
|
$_status = false,
|
|
21
|
$_sort_order;
|
hpdl
|
620
|
22
|
|
|
23
|
// class constructor
|
|
24
|
function osC_Shipping_free() {
|
|
25
|
global $osC_Language;
|
|
26
|
|
|
27
|
$this->icon = '';
|
|
28
|
|
|
29
|
$this->_title = $osC_Language->get('shipping_free_title');
|
|
30
|
$this->_description = $osC_Language->get('shipping_free_description');
|
|
31
|
$this->_status = (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') ? true : false);
|
|
32
|
}
|
|
33
|
|
|
34
|
// class methods
|
|
35
|
function isInstalled() {
|
|
36
|
return (bool)defined('MODULE_SHIPPING_FREE_STATUS');
|
|
37
|
}
|
|
38
|
|
|
39
|
function install() {
|
|
40
|
global $osC_Database;
|
|
41
|
|
|
42
|
parent::install();
|
|
43
|
|
hpdl
|
758
|
44
|
$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 Free Shipping', 'MODULE_SHIPPING_FREE_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'osc_cfg_set_boolean_value(array(\'True\', \'False\'))', now())");
|
hpdl
|
620
|
45
|
$osC_Database->simpleQuery("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FREE_MINIMUM_ORDER', '20', 'The minimum order amount to apply free shipping to.', '6', '0', now())");
|
hpdl
|
758
|
46
|
$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_FREE_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
|
47
|
}
|
|
48
|
|
|
49
|
function getKeys() {
|
|
50
|
if (!isset($this->_keys)) {
|
|
51
|
$this->_keys = array('MODULE_SHIPPING_FREE_STATUS',
|
|
52
|
'MODULE_SHIPPING_FREE_MINIMUM_ORDER',
|
|
53
|
'MODULE_SHIPPING_FREE_ZONE');
|
|
54
|
}
|
|
55
|
|
|
56
|
return $this->_keys;
|
|
57
|
}
|
|
58
|
}
|
|
59
|
?>
|
|