  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: order_total.php 431 2006-02-15 05:57:09Z hpdl $ |
| |
| 3 | + | $Id: order_total.php 432 2006-02-15 07:41:34Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
13 | 13 | | class osC_OrderTotal { |
| |
14 | 14 | | var $modules; |
| |
15 | 15 | | |
  |
| 16 | + | var $_group = 'order_total'; |
| |
| 17 | + | |
|
16 | 18 | | // class constructor |
| |
17 | 19 | | function osC_OrderTotal() { |
| |
18 | 20 | | global $osC_Database, $osC_Language; |
| |
|
|
 |
… |
|
39 | 41 | | } |
| |
40 | 42 | | } |
| |
41 | 43 | | |
  |
| 44 | + | // class methods |
| |
| 45 | + | function getCode() { |
| |
| 46 | + | return $this->_code; |
| |
| 47 | + | } |
| |
| 48 | + | |
| |
| 49 | + | function getTitle() { |
| |
| 50 | + | return $this->_title; |
| |
| 51 | + | } |
| |
| 52 | + | |
| |
| 53 | + | function getDescription() { |
| |
| 54 | + | return $this->_description; |
| |
| 55 | + | } |
| |
| 56 | + | |
| |
| 57 | + | function getStatus() { |
| |
| 58 | + | return $this->_status; |
| |
| 59 | + | } |
| |
| 60 | + | |
| |
| 61 | + | function getSortOrder() { |
| |
| 62 | + | return $this->_sort_order; |
| |
| 63 | + | } |
| |
| 64 | + | |
|
42 | 65 | | function process() { |
| |
43 | 66 | | $order_total_array = array(); |
| |
44 | 67 | | |
| |
45 | 68 | | foreach ($this->modules as $module) { |
| |
46 | 69 | | $module = 'osC_OrderTotal_' . $module; |
| |
47 | 70 | | |
  |
48 | | - | if ($GLOBALS[$module]->enabled) { |
| |
| 71 | + | if ($GLOBALS[$module]->getStatus() === true) { |
|
49 | 72 | | $GLOBALS[$module]->process(); |
| |
50 | 73 | | |
| |
51 | 74 | | foreach ($GLOBALS[$module]->output as $output) { |
| |
52 | 75 | | if (tep_not_null($output['title']) && tep_not_null($output['text'])) { |
  |
53 | | - | $order_total_array[] = array('code' => $GLOBALS[$module]->code, |
| |
| 76 | + | $order_total_array[] = array('code' => $GLOBALS[$module]->getCode(), |
|
54 | 77 | | 'title' => $output['title'], |
| |
55 | 78 | | 'text' => $output['text'], |
| |
56 | 79 | | 'value' => $output['value'], |
  |
57 | | - | 'sort_order' => $GLOBALS[$module]->sort_order); |
| |
| 80 | + | 'sort_order' => $GLOBALS[$module]->getSortOrder()); |
|
58 | 81 | | } |
| |
59 | 82 | | } |
| |
60 | 83 | | } |
| |
|
|
 |
… |
|
69 | 92 | | foreach ($this->modules as $module) { |
| |
70 | 93 | | $module = 'osC_OrderTotal_' . $module; |
| |
71 | 94 | | |
  |
72 | | - | if ($GLOBALS[$module]->enabled) { |
| |
| 95 | + | if ($GLOBALS[$module]->getStatus() === true) { |
|
73 | 96 | | foreach ($GLOBALS[$module]->output as $output) { |
| |
74 | 97 | | $output_string .= ' <tr>' . "\n" . |
| |
75 | 98 | | ' <td align="right" class="main">' . $output['title'] . '</td>' . "\n" . |
| |
|
|
 |
… |
|
89 | 112 | | $has_active = false; |
| |
90 | 113 | | |
| |
91 | 114 | | foreach ($this->modules as $module) { |
  |
92 | | - | if ($GLOBALS['osC_OrderTotal_' . $module]->enabled) { |
| |
| 115 | + | if ($GLOBALS['osC_OrderTotal_' . $module]->getStatus() === true) { |
|
93 | 116 | | $has_active = true; |
| |
94 | 117 | | break; |
| |
95 | 118 | | } |
| |
|
|
 |
… |
|
179 | 202 | | } |
| |
180 | 203 | | |
| |
181 | 204 | | function _usortModules($a, $b) { |
  |
182 | | - | if ($GLOBALS['osC_Shipping_' . $a]->sort_order == $GLOBALS['osC_Shipping_' . $b]->sort_order) { |
| |
183 | | - | return strnatcasecmp($GLOBALS['osC_Shipping_' . $a]->title, $GLOBALS['osC_Shipping_' . $a]->title); |
| |
| 205 | + | if ($GLOBALS['osC_OrderTotal_' . $a]->getSortOrder() == $GLOBALS['osC_OrderTotal_' . $b]->getSortOrder()) { |
| |
| 206 | + | return strnatcasecmp($GLOBALS['osC_OrderTotal_' . $a]->getTitle(), $GLOBALS['osC_OrderTotal_' . $a]->getTitle()); |
|
184 | 207 | | } |
| |
185 | 208 | | |
  |
186 | | - | return ($GLOBALS['osC_Shipping_' . $a]->sort_order < $GLOBALS['osC_Shipping_' . $b]->sort_order) ? -1 : 1; |
| |
| 209 | + | return ($GLOBALS['osC_OrderTotal_' . $a]->getSortOrder() < $GLOBALS['osC_OrderTotal_' . $b]->getSortOrder()) ? -1 : 1; |
  |
187 | 210 | | } |
| |
188 | 211 | | } |
| |
189 | 212 | | ?> |