  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $ |
| |
| 3 | + | $Id: general.php 1739 2007-12-20 00:52:16Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
1252 | 1252 | | } |
| |
1253 | 1253 | | |
| |
1254 | 1254 | | function tep_count_customer_orders($id = '', $check_session = true) { |
  |
1255 | | - | global $customer_id; |
| |
| 1255 | + | global $customer_id, $languages_id; |
|
1256 | 1256 | | |
| |
1257 | 1257 | | if (is_numeric($id) == false) { |
| |
1258 | 1258 | | if (tep_session_is_registered('customer_id')) { |
| |
|
|
 |
… |
|
1268 | 1268 | | } |
| |
1269 | 1269 | | } |
| |
1270 | 1270 | | |
  |
1271 | | - | $orders_check_query = tep_db_query("select count(*) as total from " . TABLE_ORDERS . " where customers_id = '" . (int)$id . "'"); |
| |
| 1271 | + | $orders_check_query = tep_db_query("select count(*) as total from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$id . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.public_flag = '1'"); |
  |
1272 | 1272 | | $orders_check = tep_db_fetch_array($orders_check_query); |
| |
1273 | 1273 | | |
| |
1274 | 1274 | | return $orders_check['total']; |