  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: shipping.php 421 2006-02-08 17:53:17Z hpdl $ |
| |
| 3 | + | $Id: shipping.php 422 2006-02-09 13:36:08Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
50 | 50 | | include('includes/modules/shipping/' . $module['file']); |
| |
51 | 51 | | |
| |
52 | 52 | | $GLOBALS[$module['class']] = new $module['class']; |
  |
| 53 | + | $GLOBALS[$module['class']]->prepare(); |
|
53 | 54 | | } |
| |
54 | 55 | | } |
| |
55 | 56 | | } |
| |
|
|
 |
… |
|
75 | 76 | | |
| |
76 | 77 | | $include_quotes = array(); |
| |
77 | 78 | | |
  |
78 | | - | foreach ($this->_modules as $value) { |
| |
79 | | - | $class = substr($value, 0, strrpos($value, '.')); |
| |
80 | | - | if (tep_not_null($module)) { |
| |
81 | | - | if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) { |
| |
| 79 | + | if (defined('MODULE_SHIPPING_FREE_STATUS') && (MODULE_SHIPPING_FREE_STATUS == 'True') && ($GLOBALS['free']->enabled)) { |
| |
| 80 | + | $include_quotes[] = 'free'; |
| |
| 81 | + | } else { |
| |
| 82 | + | foreach ($this->_modules as $value) { |
| |
| 83 | + | $class = substr($value, 0, strrpos($value, '.')); |
| |
| 84 | + | |
| |
| 85 | + | if (tep_not_null($module)) { |
| |
| 86 | + | if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) { |
| |
| 87 | + | $include_quotes[] = $class; |
| |
| 88 | + | } |
| |
| 89 | + | } elseif ($GLOBALS[$class]->enabled) { |
|
82 | 90 | | $include_quotes[] = $class; |
| |
83 | 91 | | } |
  |
84 | | - | } elseif ($GLOBALS[$class]->enabled) { |
| |
85 | | - | $include_quotes[] = $class; |
|
86 | 92 | | } |
| |
87 | 93 | | } |
| |
88 | 94 | | |
| |
|
|
 |
… |
|
100 | 106 | | return !empty($this->_quotes); |
| |
101 | 107 | | } |
| |
102 | 108 | | |
  |
| 109 | + | function numberOfQuotes() { |
| |
| 110 | + | $total_quotes = 0; |
| |
| 111 | + | |
| |
| 112 | + | foreach ($this->_quotes as $quotes) { |
| |
| 113 | + | $total_quotes += sizeof($quotes['methods']); |
| |
| 114 | + | } |
| |
| 115 | + | |
| |
| 116 | + | return $total_quotes; |
| |
| 117 | + | } |
| |
| 118 | + | |
  |
103 | 119 | | function getQuotes($method = '', $module = '') { |
| |
104 | 120 | | if ( (empty($method) === false) && (empty($module) === false) ) { |
| |
105 | 121 | | foreach ($this->_quotes as $quote) { |