Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

864
 
1420
 
1420
 
shipping.php
_> 11 <?php
  22 /*
<> 3 -  $Id: shipping.php 864 2006-08-30 01:21:58Z hpdl $
   3+  $Id: shipping.php 1420 2007-03-08 00:21:12Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
2020     function osC_Shipping($module = '') {
  2121       global $osC_Database, $osC_Language;
  2222 
<> 23 -      if (isset($_SESSION['osC_Shipping_data']) === false) {
  24 -        $_SESSION['osC_Shipping_data'] = array('quotes' => array(),
  25 -                                               'cartID' => null);
  26 -      }
   23+      $this->_quotes =& $_SESSION['osC_ShoppingCart_data']['shipping_quotes'];
2724 
<> 28 -      $this->_quotes =& $_SESSION['osC_Shipping_data']['quotes'];
  29 -      $this->_cartID =& $_SESSION['osC_Shipping_data']['cartID'];
  30 -
3125       $Qmodules = $osC_Database->query('select code from :table_templates_boxes where modules_group = "shipping"');
  3226       $Qmodules->bindTable(':table_templates_boxes', TABLE_TEMPLATES_BOXES);
  3327       $Qmodules->setCache('modules-shipping');
     
 !
6155         usort($this->_modules, array('osC_Shipping', '_usortModules'));
  6256       }
  6357 
<> 64 -      $this->_calculate();
   58+      if ( empty($this->_quotes) ) {
   59+        $this->_calculate();
   60+      }
6561     }
  6662 
  6763 // class methods
     
 !
171167     }
  172168 
  173169     function _calculate() {
<> 174 -      global $osC_ShoppingCart;
   170+      $this->_quotes = array();
175171 
<> 176 -      if ($this->_cartID != $osC_ShoppingCart->getCartID()) {
  177 -        $this->_cartID = $osC_ShoppingCart->getCartID();
   172+      if (is_array($this->_modules)) {
   173+        $include_quotes = array();
178174 
<> 179 -        $this->_quotes = array();
  180 -
  181 -        if (is_array($this->_modules)) {
  182 -          $include_quotes = array();
  183 -
  184 -          if (defined('MODULE_SHIPPING_FREE_STATUS') && isset($GLOBALS['osC_Shipping_free']) && $GLOBALS['osC_Shipping_free']->isEnabled()) {
  185 -            $include_quotes[] = 'osC_Shipping_free';
  186 -          } else {
  187 -            foreach ($this->_modules as $module) {
  188 -              if ($GLOBALS['osC_Shipping_' . $module]->isEnabled()) {
  189 -                $include_quotes[] = 'osC_Shipping_' . $module;
  190 -              }
   175+        if (defined('MODULE_SHIPPING_FREE_STATUS') && isset($GLOBALS['osC_Shipping_free']) && $GLOBALS['osC_Shipping_free']->isEnabled()) {
   176+          $include_quotes[] = 'osC_Shipping_free';
   177+        } else {
   178+          foreach ($this->_modules as $module) {
   179+            if ($GLOBALS['osC_Shipping_' . $module]->isEnabled()) {
   180+              $include_quotes[] = 'osC_Shipping_' . $module;
191181             }
  192182           }
<>  183+        }
193184 
<> 194 -          foreach ($include_quotes as $module) {
  195 -            $quotes = $GLOBALS[$module]->quote();
   185+        foreach ($include_quotes as $module) {
   186+          $quotes = $GLOBALS[$module]->quote();
196187 
<> 197 -            if (is_array($quotes)) {
  198 -              $this->_quotes[] = $quotes;
  199 -            }
   188+          if (is_array($quotes)) {
   189+            $this->_quotes[] = $quotes;
<_ 200190           }
  201191         }
  202192       }