  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: order.php 546 2006-04-28 21:19:09Z hpdl $ |
| |
| 3 | + | $Id: order.php 548 2006-04-29 02:36:44Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
196 | 196 | | $order_products_id = $osC_Database->nextID(); |
| |
197 | 197 | | |
| |
198 | 198 | | if ($osC_ShoppingCart->hasAttributes($products['id'])) { |
  |
199 | | - | foreach ($osC_ShoppingCart->getAttributes($products['id']) as $atttributes) { |
| |
| 199 | + | foreach ($osC_ShoppingCart->getAttributes($products['id']) as $attributes) { |
|
200 | 200 | | if (DOWNLOAD_ENABLED == '1') { |
| |
201 | 201 | | $Qattributes = $osC_Database->query('select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount, pad.products_attributes_filename from :table_products_options popt, :table_products_options_values poval, :table_products_attributes pa left join :table_products_attributes_download pad on (pa.products_attributes_id = pad.products_attributes_id) 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 = :popt_language_id and poval.language_id = :poval_language_id'); |
| |
202 | 202 | | $Qattributes->bindTable(':table_products_options', TABLE_PRODUCTS_OPTIONS); |
| |
|
|
 |
… |
|
354 | 354 | | $osC_Language->get('email_order_separator') . "\n" . |
| |
355 | 355 | | sprintf($osC_Language->get('email_order_order_number'), $id) . "\n" . |
| |
356 | 356 | | sprintf($osC_Language->get('email_order_invoice_url'), tep_href_link(FILENAME_ACCOUNT, 'orders=' . $id, 'SSL', false, true, true)) . "\n" . |
  |
357 | | - | sprintf($osC_Language->get('email_order_date_ordered'), osC_DateTime::getLong()) . "\n\n"; |
| |
| 357 | + | sprintf($osC_Language->get('email_order_date_ordered'), osC_DateTime::getLong()) . "\n\n" . |
| |
| 358 | + | $osC_Language->get('email_order_products') . "\n" . |
| |
| 359 | + | $osC_Language->get('email_order_separator') . "\n"; |
|
358 | 360 | | |
  |
359 | | - | $Qproducts = $osC_Database->query('select products_model, products_name, final_price, products_tax, products_quantity from :table_orders_products where orders_id = :orders_id order by orders_products_id'); |
| |
| 361 | + | $Qproducts = $osC_Database->query('select orders_products_id, products_model, products_name, final_price, products_tax, products_quantity from :table_orders_products where orders_id = :orders_id order by orders_products_id'); |
|
360 | 362 | | $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS); |
| |
361 | 363 | | $Qproducts->bindInt(':orders_id', $id); |
| |
362 | 364 | | $Qproducts->execute(); |
| |
363 | 365 | | |
  |
364 | | - | $products_ordered = ''; |
| |
365 | | - | |
|
366 | 366 | | while ($Qproducts->next()) { |
  |
367 | | - | $products_ordered .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $Qproducts->value('products_model') . ') = ' . $osC_Currencies->displayPriceWithTaxRate($Qproducts->value('final_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), $Qorder->value('currency'), $Qorder->value('currency_value')) . "\n"; // . $products_ordered_attributes . "\n"; |
| |
| 367 | + | $email_order .= $Qproducts->valueInt('products_quantity') . ' x ' . $Qproducts->value('products_name') . ' (' . $Qproducts->value('products_model') . ') = ' . $osC_Currencies->displayPriceWithTaxRate($Qproducts->value('final_price'), $Qproducts->value('products_tax'), $Qproducts->valueInt('products_quantity'), $Qorder->value('currency'), $Qorder->value('currency_value')) . "\n"; |
| |
| 368 | + | |
| |
| 369 | + | $Qattributes = $osC_Database->query('select products_options, products_options_values from :table_orders_products_attributes where orders_id = :orders_id and orders_products_id = :orders_products_id order by orders_products_attributes_id'); |
| |
| 370 | + | $Qattributes->bindTable(':table_orders_products_attributes', TABLE_ORDERS_PRODUCTS_ATTRIBUTES); |
| |
| 371 | + | $Qattributes->bindInt(':orders_id', $id); |
| |
| 372 | + | $Qattributes->bindInt(':orders_products_id', $Qproducts->valueInt('orders_products_id')); |
| |
| 373 | + | $Qattributes->execute(); |
| |
| 374 | + | |
| |
| 375 | + | while ($Qattributes->next()) { |
| |
| 376 | + | $email_order .= "\t" . $Qattributes->value('products_options') . ': ' . $Qattributes->value('products_options_values') . "\n"; |
| |
| 377 | + | } |
|
368 | 378 | | } |
| |
369 | 379 | | |
| |
370 | 380 | | unset($Qproducts); |
  |
| 381 | + | unset($Qattributes); |
|
371 | 382 | | |
  |
372 | | - | $email_order .= $osC_Language->get('email_order_products') . "\n" . |
| |
373 | | - | $osC_Language->get('email_order_separator') . "\n" . |
| |
374 | | - | $products_ordered . |
| |
375 | | - | $osC_Language->get('email_order_separator') . "\n"; |
| |
| 383 | + | $email_order .= $osC_Language->get('email_order_separator') . "\n"; |
  |
376 | 384 | | |
| |
377 | 385 | | $Qtotals = $osC_Database->query('select title, text from :table_orders_total where orders_id = :orders_id order by sort_order'); |
| |
378 | 386 | | $Qtotals->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL); |