Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1739
 
1841
 
1841
 
table.php
_> 11 <?php
  22 /*
<> 3 -  $Id: table.php 1739 2007-12-20 00:52:16Z hpdl $
   3+  $Id: table.php 1841 2008-12-12 13:25:49Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
  77 
<> 8 -  Copyright (c) 2003 osCommerce
   8+  Copyright (c) 2008 osCommerce
99 
  1010   Released under the GNU General Public License
  1111 */
     
 !
4646 
  4747 // class methods
  4848     function quote($method = '') {
<> 49 -      global $order, $cart, $shipping_weight, $shipping_num_boxes;
   49+      global $order, $shipping_weight, $shipping_num_boxes;
5050 
  5151       if (MODULE_SHIPPING_TABLE_MODE == 'price') {
<> 52 -        $order_total = $cart->show_total();
   52+        $order_total = $this->getShippableTotal();
5353       } else {
  5454         $order_total = $shipping_weight;
  5555       }
     
 !
107107     function keys() {
  108108       return array('MODULE_SHIPPING_TABLE_STATUS', 'MODULE_SHIPPING_TABLE_COST', 'MODULE_SHIPPING_TABLE_MODE', 'MODULE_SHIPPING_TABLE_HANDLING', 'MODULE_SHIPPING_TABLE_TAX_CLASS', 'MODULE_SHIPPING_TABLE_ZONE', 'MODULE_SHIPPING_TABLE_SORT_ORDER');
  109109     }
<>  110+
   111+    function getShippableTotal() {
   112+      global $order, $cart, $currencies;
   113+
   114+      $order_total = $cart->show_total();
   115+
   116+      if ($order->content_type == 'mixed') {
   117+        $order_total = 0;
   118+
   119+        for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
   120+          $order_total += $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
   121+
   122+          if (isset($order->products[$i]['attributes'])) {
   123+            reset($order->products[$i]['attributes']);
   124+            while (list($option, $value) = each($order->products[$i]['attributes'])) {
   125+              $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id");
   126+              $virtual_check = tep_db_fetch_array($virtual_check_query);
   127+
   128+              if ($virtual_check['total'] > 0) {
   129+                $order_total -= $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']);
   130+              }
   131+            }
   132+          }
   133+        }
   134+      }
   135+
   136+      return $order_total;
   137+    }
<_ 110138   }
  111139 ?>