[TEP-COMMIT] [CVS catalog] use the new database class
hpdl-OfajU3CKLf1/[email protected] 25 Feb 2005 18:39:12 -0000
| Newsgroups | gmane.comp.web.oscommerce.cvs |
|---|---|
| Message-ID | <[email protected]> |
<html>
<head>
<style><!--
body {background-color:#ffffff;}
.file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
.pathname {font-family:monospace; float:right;}
.fileheader {margin-bottom:.5em;}
.diff {margin:0;}
.tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
.tasklist ul {margin-top:0;margin-bottom:0;}
tr.alt {background-color:#eeeeee}
#added {background-color:#ddffdd;}
#addedchars {background-color:#99ff99;font-weight:bolder;}
tr.alt #added {background-color:#ccf7cc;}
#removed {background-color:#ffdddd;}
#removedchars {background-color:#ff9999;font-weight:bolder;}
tr.alt #removed {background-color:#f7cccc;}
#info {color:#888888;}
#context {background-color:#eeeeee;}
td {padding-left:.3em;padding-right:.3em;}
tr.head {border-bottom-width:1px;border-bottom-style:solid;}
tr.head td {padding:0;padding-top:.2em;}
.task {background-color:#ffff00;}
.comment {padding:4px;border:1px dashed #000000;background-color:#ffffdd}
.error {color:red;}
hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="4">Commit in <b><tt>catalog/catalog/includes/classes</tt></b><span id="info"> on MAIN</span></td></tr>
<tr><td><tt><a href="#file1">order.php</a></tt></td><td align="right" id="added">+192</td><td align="right" id="removed">-137</td><td nowrap="nowrap" align="center"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php?rev=1.35&content-type=text/vnd.viewcvs-markup">1.35</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php.diff?r1=1.35&r2=1.36">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php?rev=1.36&content-type=text/vnd.viewcvs-markup">1.36</a></td></tr>
</table>
<pre class="comment">
use the new database class
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog">catalog</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes">includes</a>/<a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes">classes</a><br /></span>
<div class="fileheader"><big><b>order.php</b></big> <small id="info"><a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php?rev=1.35&content-type=text/vnd.viewcvs-markup">1.35</a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php.diff?r1=1.35&r2=1.36">-></a> <a href="http://cvs.oscommerce.com/viewcvs.cgi/catalog/catalog/includes/classes/order.php?rev=1.36&content-type=text/vnd.viewcvs-markup">1.36</a></small></div>
<pre class="diff"><small id="info">diff -u -r1.35 -r1.36
--- order.php 2003/12/18 23:52:14 1.35
+++ order.php 2005/02/25 18:39:09 1.36
@@ -5,7 +5,7 @@
</small></pre><pre class="diff" id="context"> osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
</pre><pre class="diff" id="removed">- Copyright (c) 200<span id="removedchars">3</span> osCommerce
</pre><pre class="diff" id="added">+ Copyright (c) 200<span id="addedchars">5</span> osCommerce
</pre><pre class="diff" id="context">
Released under the GNU General Public License
*/
</pre><pre class="diff"><small id="info">@@ -28,97 +28,124 @@
</small></pre><pre class="diff" id="context"> }
function query($order_id) {
</pre><pre class="diff" id="removed">- global $osC_Session;
</pre><pre class="diff" id="added">+ global $osC_Database, $osC_Session;
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $order_id = tep_db_prepare_input($order_id);
</pre><pre class="diff" id="added">+ $Qorder = $osC_Database->query('select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from :table_orders where orders_id = :orders_id');
+ $Qorder->bindTable(':table_orders', TABLE_ORDERS);
+ $Qorder->bindInt(':orders_id', $order_id);
+ $Qorder->execute();
+
+ $Qtotals = $osC_Database->query('select title, text, class from :table_orders_total where orders_id = :orders_id order by sort_order');
+ $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL);
+ $Qtotals->bindInt(':orders_id', $order_id);
+ $Qtotals->execute();
+
+ $shipping_method_string = '';
+ $order_total_string = '';
+
+ while ($Qtotals->next()) {
+ $this->totals[] = array('title' => $Qtotals->value('title'),
+ 'text' => $Qtotals->value('text'));
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $order_query = tep_db_query("select customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'");
- $order = tep_db_fetch_array($order_query);
</pre><pre class="diff" id="added">+ if ($Qtotals->value('class') == 'ot_shipping') {
+ $shipping_method_string = strip_tags($Qtotals->value('title'));
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $totals_query = tep_db_query("select title, text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order");
- while ($totals = tep_db_fetch_array($totals_query)) {
- $this->totals[] = array('title' => $totals['title'],
- 'text' => $totals['text']);
- }
-
- $order_total_query = tep_db_query("select text from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_total'");
- $order_total = tep_db_fetch_array($order_total_query);
-
- $shipping_method_query = tep_db_query("select title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' and class = 'ot_shipping'");
- $shipping_method = tep_db_fetch_array($shipping_method_query);
</pre><pre class="diff" id="added">+ if (substr($shipping_method_string, -1) == ':') {
+ $shipping_method_string = substr($Qtotals->value('title'), 0, -1);
+ }
+ }
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $order_status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order['orders_status'] . "' and language_id = '" . (int)$osC_Session->value('languages_id') . "'");
- $order_status = tep_db_fetch_array($order_status_query);
</pre><pre class="diff" id="added">+ if ($Qtotals->value('class') == 'ot_total') {
+ $order_total_string = strip_tags($Qtotals->value('text'));
+ }
+ }
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $this->info = array('currency' => $order['currency'],
- 'currency_value' => $order['currency_value'],
- 'payment_method' => $order['payment_method'],
- 'cc_type' => $order['cc_type'],
- 'cc_owner' => $order['cc_owner'],
- 'cc_number' => $order['cc_number'],
- 'cc_expires' => $order['cc_expires'],
- 'date_purchased' => $order['date_purchased'],
- 'orders_status' => $order_status['orders_status_name'],
- 'last_modified' => $order['last_modified'],
- 'total' => strip_tags($order_total['text']),
- 'shipping_method' => ((substr($shipping_method['title'], -1) == ':') ? substr(strip_tags($shipping_method['title']), 0, -1) : strip_tags($shipping_method['title'])));
-
- $this->customer = array('id' => $order['customers_id'],
- 'name' => $order['customers_name'],
- 'company' => $order['customers_company'],
- 'street_address' => $order['customers_street_address'],
- 'suburb' => $order['customers_suburb'],
- 'city' => $order['customers_city'],
- 'postcode' => $order['customers_postcode'],
- 'state' => $order['customers_state'],
- 'country' => $order['customers_country'],
- 'format_id' => $order['customers_address_format_id'],
- 'telephone' => $order['customers_telephone'],
- 'email_address' => $order['customers_email_address']);
-
- $this->delivery = array('name' => $order['delivery_name'],
- 'company' => $order['delivery_company'],
- 'street_address' => $order['delivery_street_address'],
- 'suburb' => $order['delivery_suburb'],
- 'city' => $order['delivery_city'],
- 'postcode' => $order['delivery_postcode'],
- 'state' => $order['delivery_state'],
- 'country' => $order['delivery_country'],
- 'format_id' => $order['delivery_address_format_id']);
</pre><pre class="diff" id="added">+ $Qstatus = $osC_Database->query('select orders_status_name from :table_orders_status where orders_status_id = :orders_status_id and language_id = :language_id');
+ $Qstatus->bindTable(':table_orders_status', TABLE_ORDERS_STATUS);
+ $Qstatus->bindInt(':orders_status', $Qorder->valueInt('orders_status'));
+ $Qstatus->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qstatus->execute();
+
+ $this->info = array('currency' => $Qorder->value('currency'),
+ 'currency_value' => $Qorder->value('currency_value'),
+ 'payment_method' => $Qorder->value('payment_method'),
+ 'cc_type' => $Qorder->value('cc_type'),
+ 'cc_owner' => $Qorder->valueProtected('cc_owner'),
+ 'cc_number' => $Qorder->valueProtected('cc_number'),
+ 'cc_expires' => $Qorder->valueProtected('cc_expires'),
+ 'date_purchased' => $Qorder->value('date_purchased'),
+ 'orders_status' => $Qstatus->value('orders_status_name'),
+ 'last_modified' => $Qorder->value('last_modified'),
+ 'total' => $order_total_string,
+ 'shipping_method' => $shipping_method_string);
+
+ $this->customer = array('id' => $Qorder->valueInt('customers_id'),
+ 'name' => $Qorder->valueProtected('customers_name'),
+ 'company' => $Qorder->valueProtected('customers_company'),
+ 'street_address' => $Qorder->valueProtected('customers_street_address'),
+ 'suburb' => $Qorder->valueProtected('customers_suburb'),
+ 'city' => $Qorder->valueProtected('customers_city'),
+ 'postcode' => $Qorder->valueProtected('customers_postcode'),
+ 'state' => $Qorder->valueProtected('customers_state'),
+ 'country' => $Qorder->valueProtected('customers_country'),
+ 'format_id' => $Qorder->valueInt('customers_address_format_id'),
+ 'telephone' => $Qorder->valueProtected('customers_telephone'),
+ 'email_address' => $Qorder->valueProtected('customers_email_address'));
+
+ $this->delivery = array('name' => $Qorder->valueProtected('delivery_name'),
+ 'company' => $Qorder->valueProtected('delivery_company'),
+ 'street_address' => $Qorder->valueProtected('delivery_street_address'),
+ 'suburb' => $Qorder->valueProtected('delivery_suburb'),
+ 'city' => $Qorder->valueProtected('delivery_city'),
+ 'postcode' => $Qorder->valueProtected('delivery_postcode'),
+ 'state' => $Qorder->valueProtected('delivery_state'),
+ 'country' => $Qorder->valueProtected('delivery_country'),
+ 'format_id' => $Qorder->valueInt('delivery_address_format_id'));
</pre><pre class="diff" id="context">
if (empty($this->delivery['name']) && empty($this->delivery['street_address'])) {
$this->delivery = false;
}
</pre><pre class="diff" id="removed">- $this->billing = array('name' => $order['billing_name'],
- 'company' => $order['billing_company'],
- 'street_address' => $order['billing_street_address'],
- 'suburb' => $order['billing_suburb'],
- 'city' => $order['billing_city'],
- 'postcode' => $order['billing_postcode'],
- 'state' => $order['billing_state'],
- 'country' => $order['billing_country'],
- 'format_id' => $order['billing_address_format_id']);
</pre><pre class="diff" id="added">+ $this->billing = array('name' => $Qorder->valueProtected('billing_name'),
+ 'company' => $Qorder->valueProtected('billing_company'),
+ 'street_address' => $Qorder->valueProtected('billing_street_address'),
+ 'suburb' => $Qorder->valueProtected('billing_suburb'),
+ 'city' => $Qorder->valueProtected('billing_city'),
+ 'postcode' => $Qorder->valueProtected('billing_postcode'),
+ 'state' => $Qorder->valueProtected('billing_state'),
+ 'country' => $Qorder->valueProtected('billing_country'),
+ 'format_id' => $Qorder->valueInt('billing_address_format_id'));
+
+ $Qproducts = $osC_Database->query('select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from :table_orders_products where orders_id = :orders_id');
+ $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
+ $Qproducts->bindInt(':orders_id', $order_id);
+ $Qproducts->execute();
</pre><pre class="diff" id="context">
$index = 0;
</pre><pre class="diff" id="removed">- $orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");
- while ($orders_products = tep_db_fetch_array($orders_products_query)) {
- $this->products[$index] = array('qty' => $orders_products['products_quantity'],
- 'id' => $orders_products['products_id'],
- 'name' => $orders_products['products_name'],
- 'model' => $orders_products['products_model'],
- 'tax' => $orders_products['products_tax'],
- 'price' => $orders_products['products_price'],
- 'final_price' => $orders_products['final_price']);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="added">+ while ($Qproducts->next()) {
</pre><pre class="diff" id="context"> $subindex = 0;
</pre><pre class="diff" id="removed">- $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'");
- if (tep_db_num_rows($attributes_query)) {
- while ($attributes = tep_db_fetch_array($attributes_query)) {
- $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'],
- 'value' => $attributes['products_options_values'],
- 'prefix' => $attributes['price_prefix'],
- 'price' => $attributes['options_values_price']);
</pre><pre class="diff" id="added">+
+ $this->products[$index] = array('qty' => $Qproducts->valueInt('products_quantity'),
+ 'id' => $Qproducts->valueInt('products_id'),
+ 'name' => $Qproducts->value('products_name'),
+ 'model' => $Qproducts->value('products_model'),
+ 'tax' => $Qproducts->value('products_tax'),
+ 'price' => $Qproducts->value('products_price'),
+ 'final_price' => $Qproducts->value('final_price'));
+
+ $Qattributes = $osC_Database->query('select products_options, products_options_values, options_values_price, price_prefix from :table_orders_products_attributes where orders_id = :orders_id and orders_products_id = :orders_products_id');
+ $Qattributes->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES);
+ $Qattributes->bindInt(':orders_id', $order_id);
+ $Qattributes->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id'));
+ $Qattributes->execute();
+
+ if ($Qattributes->numberOfRows()) {
+ while ($Qattributes->next()) {
+ $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options'),
+ 'value' => $Qattributes->value('products_options_values'),
+ 'prefix' => $Qattributes->value('price_prefix'),
+ 'price' => $Qattributes->value('options_values_price'));
</pre><pre class="diff" id="context">
$subindex++;
}
</pre><pre class="diff"><small id="info">@@ -131,24 +158,44 @@
</small></pre><pre class="diff" id="context"> }
function cart() {
</pre><pre class="diff" id="removed">- global $osC_Session, $osC_Customer, $osC_Tax, $cart, $osC_Currencies;
</pre><pre class="diff" id="added">+ global $osC_<span id="addedchars">Database, $osC_</span>Session, $osC_Customer, $osC_Tax, $cart, $osC_Currencies;
</pre><pre class="diff" id="context">
$this->content_type = $cart->get_content_type();
$shipping =& $osC_Session->value('shipping');
$payment =& $osC_Session->value('payment');
</pre><pre class="diff" id="removed">-
- $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int)$osC_Customer->id . "' and ab.customers_id = '" . (int)$osC_Customer->id . "' and c.customers_default_address_id = ab.address_book_id");
- $customer_address = tep_db_fetch_array($customer_address_query);
-
- $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$osC_Customer->id . "' and ab.address_book_id = '" . (int)$osC_Session->value('sendto') . "'");
- $shipping_address = tep_db_fetch_array($shipping_address_query);
-
- $billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$osC_Customer->id . "' and ab.address_book_id = '" . (int)$osC_Session->value('billto') . "'");
- $billing_address = tep_db_fetch_array($billing_address_query);
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$osC_Customer->id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $osC_Session->value('billto') : $osC_Session->value('sendto')) . "'");
- $tax_address = tep_db_fetch_array($tax_address_query);
</pre><pre class="diff" id="added">+ $Qcustomer = $osC_Database->query('select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from :table_customers c, :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries co on (ab.entry_country_id = co.countries_id) where c.customers_id = :customers_id and ab.customers_id = :customers_id and c.customers_default_address_id = ab.address_book_id');
+ $Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
+ $Qcustomer->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qcustomer->bindTable(':table_zones', TABLE_ZONES);
+ $Qcustomer->bindTable(':table_countries', TABLE_COUNTRIES);
+ $Qcustomer->bindInt(':customers_id', $osC_Customer->id);
+ $Qcustomer->bindInt(':customers_id', $osC_Customer->id);
+ $Qcustomer->execute();
+
+ $Qshipping = $osC_Database->query('select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries c on (ab.entry_country_id = c.countries_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id');
+ $Qshipping->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qshipping->bindTable(':table_zones', TABLE_ZONES);
+ $Qshipping->bindTable(':table_countries', TABLE_COUNTRIES);
+ $Qshipping->bindInt(':customers_id', $osC_Customer->id);
+ $Qshipping->bindInt(':address_book_id', $osC_Session->value('sendto'));
+ $Qshipping->execute();
+
+ $Qbilling = $osC_Database->query('select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) left join :table_countries c on (ab.entry_country_id = c.countries_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id');
+ $Qbilling->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qbilling->bindTable(':table_zones', TABLE_ZONES);
+ $Qbilling->bindTable(':table_countries', TABLE_COUNTRIES);
+ $Qbilling->bindInt(':customers_id', $osC_Customer->id);
+ $Qbilling->bindInt(':address_book_id', $osC_Session->value('billto'));
+ $Qbilling->execute();
+
+ $Qtax = $osC_Database->query('select ab.entry_country_id, ab.entry_zone_id from :table_address_book ab left join :table_zones z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = :customers_id and ab.address_book_id = :address_book_id');
+ $Qtax->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
+ $Qtax->bindTable(':table_zones', TABLE_ZONES);
+ $Qtax->bindInt(':customers_id', $osC_Customer->id);
+ $Qtax->bindInt(':address_book_id', ($this->content_type == 'virtual' ? $osC_Session->value('billto') : $osC_Session->value('sendto')));
+ $Qtax->execute();
</pre><pre class="diff" id="context">
$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
'currency' => $osC_Session->value('currency'),
</pre><pre class="diff"><small id="info">@@ -173,45 +220,45 @@
</small></pre><pre class="diff" id="context"> }
}
</pre><pre class="diff" id="removed">- $this->customer = array('firstname' => $customer_address['customers_firstname'],
- 'lastname' => $customer_address['customers_lastname'],
- 'company' => $customer_address['entry_company'],
- 'street_address' => $customer_address['entry_street_address'],
- 'suburb' => $customer_address['entry_suburb'],
- 'city' => $customer_address['entry_city'],
- 'postcode' => $customer_address['entry_postcode'],
- 'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),
- 'zone_id' => $customer_address['entry_zone_id'],
- 'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),
- 'format_id' => $customer_address['address_format_id'],
- 'telephone' => $customer_address['customers_telephone'],
- 'email_address' => $customer_address['customers_email_address']);
-
- $this->delivery = array('firstname' => $shipping_address['entry_firstname'],
- 'lastname' => $shipping_address['entry_lastname'],
- 'company' => $shipping_address['entry_company'],
- 'street_address' => $shipping_address['entry_street_address'],
- 'suburb' => $shipping_address['entry_suburb'],
- 'city' => $shipping_address['entry_city'],
- 'postcode' => $shipping_address['entry_postcode'],
- 'state' => ((tep_not_null($shipping_address['entry_state'])) ? $shipping_address['entry_state'] : $shipping_address['zone_name']),
- 'zone_id' => $shipping_address['entry_zone_id'],
- 'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']),
- 'country_id' => $shipping_address['entry_country_id'],
- 'format_id' => $shipping_address['address_format_id']);
-
- $this->billing = array('firstname' => $billing_address['entry_firstname'],
- 'lastname' => $billing_address['entry_lastname'],
- 'company' => $billing_address['entry_company'],
- 'street_address' => $billing_address['entry_street_address'],
- 'suburb' => $billing_address['entry_suburb'],
- 'city' => $billing_address['entry_city'],
- 'postcode' => $billing_address['entry_postcode'],
- 'state' => ((tep_not_null($billing_address['entry_state'])) ? $billing_address['entry_state'] : $billing_address['zone_name']),
- 'zone_id' => $billing_address['entry_zone_id'],
- 'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']),
- 'country_id' => $billing_address['entry_country_id'],
- 'format_id' => $billing_address['address_format_id']);
</pre><pre class="diff" id="added">+ $this->customer = array('firstname' => $Qcustomer->valueProtected('customers_firstname'),
+ 'lastname' => $Qcustomer->valueProtected('customers_lastname'),
+ 'company' => $Qcustomer->valueProtected('entry_company'),
+ 'street_address' => $Qcustomer->valueProtected('entry_street_address'),
+ 'suburb' => $Qcustomer->valueProtected('entry_suburb'),
+ 'city' => $Qcustomer->valueProtected('entry_city'),
+ 'postcode' => $Qcustomer->valueProtected('entry_postcode'),
+ 'state' => (tep_not_null($Qcustomer->valueProtected('entry_state')) ? $Qcustomer->valueProtected('entry_state') : $Qcustomer->valueProtected('zone_name')),
+ 'zone_id' => $Qcustomer->valueInt('entry_zone_id'),
+ 'country' => array('id' => $Qcustomer->valueInt('countries_id'), 'title' => $Qcustomer->value('countries_name'), 'iso_code_2' => $Qcustomer->value('countries_iso_code_2'), 'iso_code_3' => $Qcustomer->value('countries_iso_code_3')),
+ 'format_id' => $Qcustomer->valueInt('address_format_id'),
+ 'telephone' => $Qcustomer->valueProtected('customers_telephone'),
+ 'email_address' => $Qcustomer->valueProtected('customers_email_address'));
+
+ $this->delivery = array('firstname' => $Qshipping->valueProtected('entry_firstname'),
+ 'lastname' => $Qshipping->valueProtected('entry_lastname'),
+ 'company' => $Qshipping->valueProtected('entry_company'),
+ 'street_address' => $Qshipping->valueProtected('entry_street_address'),
+ 'suburb' => $Qshipping->valueProtected('entry_suburb'),
+ 'city' => $Qshipping->valueProtected('entry_city'),
+ 'postcode' => $Qshipping->valueProtected('entry_postcode'),
+ 'state' => (tep_not_null($Qshipping->valueProtected('entry_state')) ? $Qshipping->valueProtected('entry_state') : $Qshipping->valueProtected('zone_name')),
+ 'zone_id' => $Qshipping->valueInt('entry_zone_id'),
+ 'country' => array('id' => $Qshipping->valueInt('countries_id'), 'title' => $Qshipping->value('countries_name'), 'iso_code_2' => $Qshipping->value('countries_iso_code_2'), 'iso_code_3' => $Qshipping->value('countries_iso_code_3')),
+ 'country_id' => $Qshipping->valueInt('entry_country_id'),
+ 'format_id' => $Qshipping->valueInt('address_format_id'));
+
+ $this->billing = array('firstname' => $Qbilling->valueProtected('entry_firstname'),
+ 'lastname' => $Qbilling->valueProtected('entry_lastname'),
+ 'company' => $Qbilling->valueProtected('entry_company'),
+ 'street_address' => $Qbilling->valueProtected('entry_street_address'),
+ 'suburb' => $Qbilling->valueProtected('entry_suburb'),
+ 'city' => $Qbilling->valueProtected('entry_city'),
+ 'postcode' => $Qbilling->valueProtected('entry_postcode'),
+ 'state' => (tep_not_null($Qbilling->valueProtected('entry_state')) ? $Qbilling->valueProtected('entry_state') : $Qbilling->valueProtected('zone_name')),
+ 'zone_id' => $Qbilling->valueInt('entry_zone_id'),
+ 'country' => array('id' => $Qbilling->valueInt('countries_id'), 'title' => $Qbilling->value('countries_name'), 'iso_code_2' => $Qbilling->value('countries_iso_code_2'), 'iso_code_3' => $Qbilling->value('countries_iso_code_3')),
+ 'country_id' => $Qbilling->valueInt('entry_country_id'),
+ 'format_id' => $Qbilling->valueInt('address_format_id'));
</pre><pre class="diff" id="context">
$index = 0;
$products = $cart->get_products();
</pre><pre class="diff"><small id="info">@@ -219,8 +266,8 @@
</small></pre><pre class="diff" id="context"> $this->products[$index] = array('qty' => $products[$i]['quantity'],
'name' => $products[$i]['name'],
'model' => $products[$i]['model'],
</pre><pre class="diff" id="removed">- 'tax' => $osC_Tax->getTaxRate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
- 'tax_description' => $osC_Tax->getTaxRateDescription($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']),
</pre><pre class="diff" id="added">+ 'tax' => $osC_Tax->getTaxRate($products[$i]['tax_class_id'], $Qtax->valueInt('entry_country_id'), $Qtax->valueInt('entry_zone_id')),
+ 'tax_description' => $osC_Tax->getTaxRateDescription($products[$i]['tax_class_id'], $Qtax->valueInt('entry_country_id'), $Qtax->valueInt('entry_zone_id')),
</pre><pre class="diff" id="context"> 'tax_class_id' => $products[$i]['tax_class_id'],
'price' => $products[$i]['price'],
'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
</pre><pre class="diff"><small id="info">@@ -231,15 +278,23 @@
</small></pre><pre class="diff" id="context"> $subindex = 0;
reset($products[$i]['attributes']);
while (list($option, $value) = each($products[$i]['attributes'])) {
</pre><pre class="diff" id="removed">- $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$osC_Session->value('languages_id') . "' and poval.language_id = '" . (int)$osC_Session->value('languages_id') . "'");
- $attributes = tep_db_fetch_array($attributes_query);
</pre><pre class="diff" id="added">+ $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa where pa.products_id = :products_id and pa.options_id = :options_id and pa.options_id = popt.products_options_id and pa.options_values_id = :options_values_id and pa.options_values_id = poval.products_options_values_id and popt.language_id = :language_id and poval.language_id = :language_id');
+ $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS);
+ $Qattributes->bindTable(':table_products_options_values', TABLE_PRODUCTS_OPTIONS_VALUES);
+ $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES);
+ $Qattributes->bindInt(':products_id', $products[$i]['id']);
+ $Qattributes->bindInt(':options_id', $option);
+ $Qattributes->bindInt(':options_values_id', $value);
+ $Qattributes->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qattributes->bindInt(':language_id', $osC_Session->value('languages_id'));
+ $Qattributes->execute();
</pre><pre class="diff" id="context">
</pre><pre class="diff" id="removed">- $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
- 'value' => $attributes['products_options_values_name'],
</pre><pre class="diff" id="added">+ $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options_name'),
+ 'value' => $Qattributes->value('products_options_values_name'),
</pre><pre class="diff" id="context"> 'option_id' => $option,
'value_id' => $value,
</pre><pre class="diff" id="removed">- 'prefix' => $attributes['price_prefix'],
- 'price' => $attributes['options_values_price']);
</pre><pre class="diff" id="added">+ 'prefix' => $Qattributes->value('price_prefix'),
+ 'price' => $Qattributes->value('options_values_price'));
</pre><pre class="diff" id="context">
$subindex++;
}
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -> email">CVSspam</a> 0.2.9</small></center>
</body></html>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click