| 1 |
<?php |
| 2 |
/* order data class */ |
| 3 |
|
| 4 |
class orderDataObject |
| 5 |
{ |
| 6 |
var $customer; |
| 7 |
var $deliveri; |
| 8 |
var $cart; |
| 9 |
var $condition; |
| 10 |
var $order; |
| 11 |
var $reserve; |
| 12 |
|
| 13 |
function orderDataObject($order_id) { |
| 14 |
global $wpdb, $usces_settings; |
| 15 |
|
| 16 |
$order_table = $wpdb->prefix . "usces_order"; |
| 17 |
$meta_table = $wpdb->prefix . "usces_order_meta"; |
| 18 |
$query = $wpdb->prepare("SELECT o.*, om.meta_value AS order_country |
| 19 |
FROM {$order_table} AS o |
| 20 |
LEFT JOIN {$meta_table} AS om ON o.ID = om.order_id AND om.meta_key = 'customer_country' |
| 21 |
WHERE o.ID = %d", $order_id); |
| 22 |
|
| 23 |
$data = $wpdb->get_row( $query, ARRAY_A ); |
| 24 |
|
| 25 |
$this->customer['mem_id'] = $data['mem_id']; |
| 26 |
$this->customer['email'] = $data['order_email']; |
| 27 |
$this->customer['name1'] = $data['order_name1']; |
| 28 |
$this->customer['name2'] = $data['order_name2']; |
| 29 |
$this->customer['name3'] = $data['order_name3']; |
| 30 |
$this->customer['name4'] = $data['order_name4']; |
| 31 |
$this->customer['zip'] = $data['order_zip']; |
| 32 |
$this->customer['pref'] = $data['order_pref']; |
| 33 |
$this->customer['address1'] = $data['order_address1']; |
| 34 |
$this->customer['address2'] = $data['order_address2']; |
| 35 |
$this->customer['address3'] = $data['order_address3']; |
| 36 |
$this->customer['tel'] = $data['order_tel']; |
| 37 |
$this->customer['fax'] = $data['order_fax']; |
| 38 |
$this->customer['country_code'] = $data['order_country']; |
| 39 |
$this->customer['country'] = $usces_settings['country'][$data['order_country']]; |
| 40 |
|
| 41 |
$this->deliveri = (array)unserialize($data['order_delivery']); |
| 42 |
|
| 43 |
$this->cart = (array)unserialize($data['order_cart']); |
| 44 |
|
| 45 |
$this->condition = (array)unserialize($data['order_condition']); |
| 46 |
|
| 47 |
$this->order['ID'] = $order_id; |
| 48 |
$this->order['note'] = $data['order_note']; |
| 49 |
$this->order['delidue_date'] = $data['order_delidue_date']; |
| 50 |
$this->order['delivery_date'] = $data['order_delivery_date']; |
| 51 |
$this->order['delivery_time'] = $data['order_delivery_time']; |
| 52 |
$this->order['delivery_method'] = $data['order_delivery_method']; |
| 53 |
$this->order['payment_name'] = $data['order_payment_name']; |
| 54 |
$this->order['item_total_price'] = $data['order_item_total_price']; |
| 55 |
$this->order['getpoint'] = $data['order_getpoint']; |
| 56 |
$this->order['usedpoint'] = $data['order_usedpoint']; |
| 57 |
$this->order['discount'] = $data['order_discount']; |
| 58 |
$this->order['shipping_charge'] = $data['order_shipping_charge']; |
| 59 |
$this->order['cod_fee'] = $data['order_cod_fee']; |
| 60 |
$this->order['tax'] = $data['order_tax']; |
| 61 |
$this->order['date'] = $data['order_date']; |
| 62 |
$this->order['modified'] = $data['order_modified']; |
| 63 |
$this->order['status'] = $data['order_status']; |
| 64 |
$this->order['check'] = $data['order_check']; |
| 65 |
$this->order['total_full_price'] = $data['order_item_total_price'] - $data['order_usedpoint'] + $data['order_discount'] + $data['order_shipping_charge'] + $data['order_cod_fee'] + $data['order_tax']; |
| 66 |
|
| 67 |
$this->reserve = array(); |
| 68 |
} |
| 69 |
} |
| 70 |
?> |