  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: order.php 383 2006-01-09 16:35:46Z hpdl $ |
| |
| 3 | + | $Id: order.php 443 2006-02-19 23:01:01Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
42 | 42 | | function &getListing($limit = null, $page_keyword = 'page') { |
| |
43 | 43 | | global $osC_Database, $osC_Customer, $osC_Language; |
| |
44 | 44 | | |
  |
45 | | - | $Qorders = $osC_Database->query('select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from :table_orders o, :table_orders_total ot, :table_orders_status s where o.customers_id = :customers_id and o.orders_id = ot.orders_id and ot.class = "ot_total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by orders_id desc'); |
| |
| 45 | + | $Qorders = $osC_Database->query('select o.orders_id, o.date_purchased, o.delivery_name, o.delivery_country, o.billing_name, o.billing_country, ot.text as order_total, s.orders_status_name from :table_orders o, :table_orders_total ot, :table_orders_status s where o.customers_id = :customers_id and o.orders_id = ot.orders_id and ot.class = "total" and o.orders_status = s.orders_status_id and s.language_id = :language_id order by orders_id desc'); |
|
46 | 46 | | $Qorders->bindTable(':table_orders', TABLE_ORDERS); |
| |
47 | 47 | | $Qorders->bindTable(':table_orders_total', TABLE_ORDERS_TOTAL); |
| |
48 | 48 | | $Qorders->bindTable(':table_orders_status', TABLE_ORDERS_STATUS); |
| |
|
|
 |
… |
|
146 | 146 | | $this->totals[] = array('title' => $Qtotals->value('title'), |
| |
147 | 147 | | 'text' => $Qtotals->value('text')); |
| |
148 | 148 | | |
  |
149 | | - | if ($Qtotals->value('class') == 'ot_shipping') { |
| |
| 149 | + | if ($Qtotals->value('class') == 'shipping') { |
|
150 | 150 | | $shipping_method_string = strip_tags($Qtotals->value('title')); |
| |
151 | 151 | | |
| |
152 | 152 | | if (substr($shipping_method_string, -1) == ':') { |
| |
153 | 153 | | $shipping_method_string = substr($Qtotals->value('title'), 0, -1); |
| |
154 | 154 | | } |
| |
155 | 155 | | } |
| |
156 | 156 | | |
  |
157 | | - | if ($Qtotals->value('class') == 'ot_total') { |
| |
| 157 | + | if ($Qtotals->value('class') == 'total') { |
|
158 | 158 | | $order_total_string = strip_tags($Qtotals->value('text')); |
| |
159 | 159 | | } |
| |
160 | 160 | | } |
| |
|
|
 |
… |
|
257 | 257 | | } |
| |
258 | 258 | | |
| |
259 | 259 | | function cart() { |
  |
260 | | - | global $osC_Database, $osC_Customer, $osC_Tax, $osC_Currencies, $osC_Language; |
| |
| 260 | + | global $osC_Database, $osC_ShoppingCart, $osC_Customer, $osC_Tax, $osC_Currencies, $osC_Language; |
|
261 | 261 | | |
  |
262 | | - | $this->content_type = $_SESSION['cart']->get_content_type(); |
| |
| 262 | + | $this->content_type = $osC_ShoppingCart->getContentType(); |
|
263 | 263 | | |
| |
264 | 264 | | $shipping =& $_SESSION['shipping']; |
| |
265 | 265 | | $payment =& $_SESSION['payment']; |
| |
|
|
 |
… |
|
360 | 360 | | 'format_id' => $Qbilling->valueInt('address_format_id')); |
| |
361 | 361 | | |
| |
362 | 362 | | $index = 0; |
  |
363 | | - | $products = $_SESSION['cart']->get_products(); |
| |
| 363 | + | $products = $osC_ShoppingCart->getProducts(); |
|
364 | 364 | | for ($i=0, $n=sizeof($products); $i<$n; $i++) { |
| |
365 | 365 | | $this->products[$index] = array('qty' => $products[$i]['quantity'], |
| |
366 | 366 | | 'name' => $products[$i]['name'], |
| |
|
|
 |
… |
|
369 | 369 | | 'tax_description' => $osC_Tax->getTaxRateDescription($products[$i]['tax_class_id'], $Qtax->valueInt('entry_country_id'), $Qtax->valueInt('entry_zone_id')), |
| |
370 | 370 | | 'tax_class_id' => $products[$i]['tax_class_id'], |
| |
371 | 371 | | 'price' => $products[$i]['price'], |
  |
372 | | - | 'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), |
| |
| 372 | + | 'final_price' => $products[$i]['price'] + $osC_ShoppingCart->getProductAttributesPriceTotal($products[$i]['id']), |
|
373 | 373 | | 'weight' => $products[$i]['weight'], |
| |
374 | 374 | | 'id' => $products[$i]['id']); |
| |
375 | 375 | | |
| |
|
|
 |
… |
|
383 | 383 | | $Qattributes->bindTable(':table_products_attributes', TABLE_PRODUCTS_ATTRIBUTES); |
| |
384 | 384 | | $Qattributes->bindInt(':products_id', $products[$i]['id']); |
| |
385 | 385 | | $Qattributes->bindInt(':options_id', $option); |
  |
386 | | - | $Qattributes->bindInt(':options_values_id', $value); |
| |
| 386 | + | $Qattributes->bindInt(':options_values_id', $value['value_id']); |
|
387 | 387 | | $Qattributes->bindInt(':language_id', $osC_Language->getID()); |
| |
388 | 388 | | $Qattributes->bindInt(':language_id', $osC_Language->getID()); |
| |
389 | 389 | | $Qattributes->execute(); |
| |
390 | 390 | | |
| |
391 | 391 | | $this->products[$index]['attributes'][$subindex] = array('option' => $Qattributes->value('products_options_name'), |
| |
392 | 392 | | 'value' => $Qattributes->value('products_options_values_name'), |
| |
393 | 393 | | 'option_id' => $option, |
  |
394 | | - | 'value_id' => $value, |
| |
| 394 | + | 'value_id' => $value['value_id'], |
  |
395 | 395 | | 'prefix' => $Qattributes->value('price_prefix'), |
| |
396 | 396 | | 'price' => $Qattributes->value('options_values_price')); |
| |
397 | 397 | | |