  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: order.php 1498 2007-03-29 14:04:50Z hpdl $ |
| |
| 3 | + | $Id: order.php 1862 2009-03-06 23:34:07Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
204 | 204 | | $products_array = array(); |
| |
205 | 205 | | $key = 0; |
| |
206 | 206 | | |
  |
207 | | - | $Qproducts = $osC_Database->query('select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from :table_orders_products where orders_id = :orders_id'); |
| |
| 207 | + | $Qproducts = $osC_Database->query('select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity from :table_orders_products where orders_id = :orders_id'); |
|
208 | 208 | | $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS); |
| |
209 | 209 | | $Qproducts->bindInt(':orders_id', $this->_order_id); |
| |
210 | 210 | | $Qproducts->execute(); |
| |
|
|
 |
… |
|
214 | 214 | | 'name' => $Qproducts->value('products_name'), |
| |
215 | 215 | | 'model' => $Qproducts->value('products_model'), |
| |
216 | 216 | | 'tax' => $Qproducts->value('products_tax'), |
  |
217 | | - | 'price' => $Qproducts->value('products_price'), |
| |
218 | | - | 'final_price' => $Qproducts->value('final_price')); |
| |
| 217 | + | 'price' => $Qproducts->value('products_price')); |
|
219 | 218 | | |
  |
220 | | - | $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'); |
| |
221 | | - | $Qattributes->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES); |
| |
222 | | - | $Qattributes->bindInt(':orders_id', $this->_order_id); |
| |
223 | | - | $Qattributes->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id')); |
| |
224 | | - | $Qattributes->execute(); |
| |
| 219 | + | $Qvariants = $osC_Database->query('select group_title, value_title from :table_orders_products_variants where orders_id = :orders_id and orders_products_id = :orders_products_id order by id'); |
| |
| 220 | + | $Qvariants->bindTable(':table_orders_products_variants', TABLE_ORDERS_PRODUCTS_VARIANTS); |
| |
| 221 | + | $Qvariants->bindInt(':orders_id', $this->_order_id); |
| |
| 222 | + | $Qvariants->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id')); |
| |
| 223 | + | $Qvariants->execute(); |
|
225 | 224 | | |
  |
226 | | - | if ($Qattributes->numberOfRows() > 0) { |
| |
227 | | - | while ($Qattributes->next()) { |
| |
228 | | - | $products_array[$key]['attributes'][] = array('option' => $Qattributes->value('products_options'), |
| |
229 | | - | 'value' => $Qattributes->value('products_options_values'), |
| |
230 | | - | 'prefix' => $Qattributes->value('price_prefix'), |
| |
231 | | - | 'price' => $Qattributes->value('options_values_price')); |
| |
| 225 | + | if ( $Qvariants->numberOfRows() > 0 ) { |
| |
| 226 | + | while ( $Qvariants->next() ) { |
| |
| 227 | + | $products_array[$key]['attributes'][] = array('option' => $Qvariants->value('group_title'), |
| |
| 228 | + | 'value' => $Qvariants->value('value_title')); |
|
232 | 229 | | } |
| |
233 | 230 | | } |
| |
234 | 231 | | |
| |
|
|
 |
… |
|
507 | 504 | | } |
| |
508 | 505 | | |
| |
509 | 506 | | if ($error === false) { |
  |
510 | | - | $Qopa = $osC_Database->query('delete from :table_orders_products_attributes where orders_id = :orders_id'); |
| |
511 | | - | $Qopa->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES); |
| |
512 | | - | $Qopa->bindInt(':orders_id', $id); |
| |
513 | | - | $Qopa->setLogging($_SESSION['module'], $id); |
| |
514 | | - | $Qopa->execute(); |
| |
| 507 | + | $Qvariants = $osC_Database->query('delete from :table_orders_products_variants where orders_id = :orders_id'); |
| |
| 508 | + | $Qvariants->bindTable(':table_orders_products_variants', TABLE_ORDERS_PRODUCTS_VARIANTS); |
| |
| 509 | + | $Qvariants->bindInt(':orders_id', $id); |
| |
| 510 | + | $Qvariants->setLogging($_SESSION['module'], $id); |
| |
| 511 | + | $Qvariants->execute(); |
  |
515 | 512 | | |
| |
516 | 513 | | if ($osC_Database->isError() === true) { |
| |
517 | 514 | | $error = true; |