  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: shipping.php 427 2006-02-14 13:17:50Z hpdl $ |
| |
| 3 | + | $Id: shipping.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 |
| |
|
|
 |
… |
|
15 | 15 | | $_quotes = array(), |
| |
16 | 16 | | $_shipping_boxes = 1, |
| |
17 | 17 | | $_shipping_weight = 0, |
  |
18 | | - | $_keys; |
| |
| 18 | + | $_keys, |
| |
| 19 | + | $_group = 'shipping'; |
|
19 | 20 | | |
| |
20 | 21 | | // class constructor |
| |
21 | 22 | | function osC_Shipping($module = '') { |
| |
|
|
 |
… |
|
62 | 63 | | } |
| |
63 | 64 | | } |
| |
64 | 65 | | |
  |
| 66 | + | // class methods |
| |
| 67 | + | function getCode() { |
| |
| 68 | + | return $this->_code; |
| |
| 69 | + | } |
| |
| 70 | + | |
| |
| 71 | + | function getTitle() { |
| |
| 72 | + | return $this->_title; |
| |
| 73 | + | } |
| |
| 74 | + | |
| |
| 75 | + | function getDescription() { |
| |
| 76 | + | return $this->_description; |
| |
| 77 | + | } |
| |
| 78 | + | |
| |
| 79 | + | function getStatus() { |
| |
| 80 | + | return $this->_status; |
| |
| 81 | + | } |
| |
| 82 | + | |
| |
| 83 | + | function getSortOrder() { |
| |
| 84 | + | return $this->_sort_order; |
| |
| 85 | + | } |
| |
| 86 | + | |
|
65 | 87 | | function calculateQuotes() { |
| |
66 | 88 | | global $osC_ShoppingCart; |
| |
67 | 89 | | |
| |
|
|
 |
… |
|
83 | 105 | | |
| |
84 | 106 | | $include_quotes = array(); |
| |
85 | 107 | | |
  |
86 | | - | if (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') && ($GLOBALS['osC_Shipping_free']->enabled)) { |
| |
| 108 | + | if (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') && ($GLOBALS['osC_Shipping_free']->getStatus() === true)) { |
|
87 | 109 | | $include_quotes[] = 'free'; |
| |
88 | 110 | | } else { |
| |
89 | 111 | | foreach ($this->_modules as $module) { |
  |
90 | | - | if ($GLOBALS['osC_Shipping_' . $module]->enabled) { |
| |
| 112 | + | if ($GLOBALS['osC_Shipping_' . $module]->getStatus() === true) { |
|
91 | 113 | | $include_quotes[] = 'osC_Shipping_' . $module; |
| |
92 | 114 | | } |
| |
93 | 115 | | } |
| |
|
|
 |
… |
|
144 | 166 | | |
| |
145 | 167 | | foreach ($this->_modules as $value) { |
| |
146 | 168 | | $class = 'osC_Shipping_' . $value; |
  |
147 | | - | if ($GLOBALS[$class]->enabled) { |
| |
| 169 | + | if ($GLOBALS[$class]->getStatus() === true) { |
|
148 | 170 | | $quotes = $GLOBALS[$class]->quotes; |
| |
149 | 171 | | |
| |
150 | 172 | | for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) { |
| |
|
|
 |
… |
|
180 | 202 | | $has_active = false; |
| |
181 | 203 | | |
| |
182 | 204 | | foreach ($this->_modules as $module) { |
  |
183 | | - | if ($GLOBALS['osC_Shipping_' . $module]->enabled) { |
| |
| 205 | + | if ($GLOBALS['osC_Shipping_' . $module]->getStatus() === true) { |
|
184 | 206 | | $has_active = true; |
| |
185 | 207 | | break; |
| |
186 | 208 | | } |
| |
|
|
 |
… |
|
270 | 292 | | } |
| |
271 | 293 | | |
| |
272 | 294 | | function _usortModules($a, $b) { |
  |
273 | | - | if ($GLOBALS['osC_Shipping_' . $a]->sort_order == $GLOBALS['osC_Shipping_' . $b]->sort_order) { |
| |
274 | | - | return strnatcasecmp($GLOBALS['osC_Shipping_' . $a]->title, $GLOBALS['osC_Shipping_' . $a]->title); |
| |
| 295 | + | if ($GLOBALS['osC_Shipping_' . $a]->getSortOrder() == $GLOBALS['osC_Shipping_' . $b]->getSortOrder()) { |
| |
| 296 | + | return strnatcasecmp($GLOBALS['osC_Shipping_' . $a]->getTitle(), $GLOBALS['osC_Shipping_' . $a]->getTitle()); |
|
275 | 297 | | } |
| |
276 | 298 | | |
  |
277 | | - | return ($GLOBALS['osC_Shipping_' . $a]->sort_order < $GLOBALS['osC_Shipping_' . $b]->sort_order) ? -1 : 1; |
| |
| 299 | + | return ($GLOBALS['osC_Shipping_' . $a]->getSortOrder() < $GLOBALS['osC_Shipping_' . $b]->getSortOrder()) ? -1 : 1; |
  |
278 | 300 | | } |
| |
279 | 301 | | } |
| |
280 | 302 | | ?> |