Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

703
 
1592
 
1592
 
shopping_cart.php
_> 2929           $qty = $this->contents[$products_id]['qty'];
  3030           $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
  3131           if (!tep_db_num_rows($product_query)) {
<> 32 -            tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");
   32+            tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')");
3333             if (isset($this->contents[$products_id]['attributes'])) {
  3434               reset($this->contents[$products_id]['attributes']);
  3535               while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
  3636                 tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");
  3737               }
  3838             }
  3939           } else {
<> 40 -            tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $qty . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
   40+            tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
4141           }
  4242         }
  4343       }
     
 !
237237     }
  238238 
  239239     function calculate() {
<>  240+      global $currencies;
   241+
240242       $this->total = 0;
  241243       $this->weight = 0;
  242244       if (!is_array($this->contents)) return 0;
     
 !
259261             $products_price = $specials['specials_new_products_price'];
  260262           }
  261263 
<> 262 -          $this->total += tep_add_tax($products_price, $products_tax) * $qty;
   264+          $this->total += $currencies->calculate_price($products_price, $products_tax, $qty);
263265           $this->weight += ($qty * $products_weight);
  264266         }
  265267 
     
 !
270272             $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
  271273             $attribute_price = tep_db_fetch_array($attribute_price_query);
  272274             if ($attribute_price['price_prefix'] == '+') {
<> 273 -              $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
   275+              $this->total += $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty);
274276             } else {
<> 275 -              $this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
   277+              $this->total -= $currencies->calculate_price($attribute_price['options_values_price'], $products_tax, $qty);
<_ 276278             }
  277279           }
  278280         }