  |
30 | 30 | | $sendto = $customer_default_address_id; |
| |
31 | 31 | | } else { |
| |
32 | 32 | | // verify the selected shipping address |
  |
33 | | - | $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); |
| |
34 | | - | $check_address = tep_db_fetch_array($check_address_query); |
| |
| 33 | + | if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) { |
| |
| 34 | + | $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); |
| |
| 35 | + | $check_address = tep_db_fetch_array($check_address_query); |
|
35 | 36 | | |
  |
36 | | - | if ($check_address['total'] != '1') { |
| |
37 | | - | $sendto = $customer_default_address_id; |
| |
38 | | - | if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); |
| |
| 37 | + | if ($check_address['total'] != '1') { |
| |
| 38 | + | $sendto = $customer_default_address_id; |
| |
| 39 | + | if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); |
| |
| 40 | + | } |
  |
39 | 41 | | } |
| |
40 | 42 | | } |
| |
41 | 43 | | |