Quick Search:

View

Revision:

Diff

Diff from 1498 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/trunk/oscommerce/admin/includes/modules/shipping/item.php

Annotated File View

hpdl
620
1 <?php
2 /*
3   $Id: item.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
hpdl
1498
10   This program is free software; you can redistribute it and/or modify
11   it under the terms of the GNU General Public License v2 (1991)
12   as published by the Free Software Foundation.
hpdl
620
13 */
14
15   class osC_Shipping_item extends osC_Shipping_Admin {
16     var $icon;
17
18     var $_title,
19         $_code = 'item',
20         $_author_name = 'osCommerce',
21         $_author_www = 'http://www.oscommerce.com',
22         $_status = false,
23         $_sort_order;
24
25 // class constructor
26     function osC_Shipping_item() {
27       global $osC_Language;
28
29       $this->icon = '';
30
31       $this->_title = $osC_Language->get('shipping_item_title');
32       $this->_description = $osC_Language->get('shipping_item_description');
33       $this->_status = (defined('MODULE_SHIPPING_ITEM_STATUS') && (MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
34       $this->_sort_order = (defined('MODULE_SHIPPING_ITEM_SORT_ORDER') ? MODULE_SHIPPING_ITEM_SORT_ORDER : null);
35     }
36
37 // class methods
38     function isInstalled() {
39       return (bool)defined('MODULE_SHIPPING_ITEM_STATUS');
40     }
41
42     function install() {
43       global $osC_Database;
44
45       parent::install();
46
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 ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'osc_cfg_set_boolean_value(array(\'True\', \'False\'))', 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 ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");
49       $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_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
hpdl
758
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 ('Tax Class', 'MODULE_SHIPPING_ITEM_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())");
51       $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_ITEM_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
52       $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_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
53     }
54
55     function getKeys() {
56       if (!isset($this->_keys)) {
57         $this->_keys = array('MODULE_SHIPPING_ITEM_STATUS',
58                              'MODULE_SHIPPING_ITEM_COST',
59                              'MODULE_SHIPPING_ITEM_HANDLING',
60                              'MODULE_SHIPPING_ITEM_TAX_CLASS',
61                              'MODULE_SHIPPING_ITEM_ZONE',
62                              'MODULE_SHIPPING_ITEM_SORT_ORDER');
63       }
64
65       return $this->_keys;
66     }
67   }
68 ?>