Ejemplo n.º 1
0
 function loadOrder()
 {
     global $toC_Json;
     $osC_Order = new osC_Order(isset($_REQUEST['orders_id']) ? $_REQUEST['orders_id'] : null);
     require_once '../includes/classes/customer.php';
     $osC_Customer = new osC_Customer();
     $osC_Customer->setCustomerData($osC_Order->getCustomersID());
     $enable_store_credit = false;
     if ($osC_Order->isUseStoreCredit() || $osC_Customer->hasStoreCredit()) {
         $enable_store_credit = true;
     }
     $data = array('customers_name' => $osC_Order->_customer['name'], 'currency' => $osC_Order->getCurrency(), 'email_address' => $osC_Order->_customer['email_address'], 'coupon_code' => $osC_Order->_coupon_code, 'payment_method' => $osC_Order->getPaymentModule(), 'use_store_credit' => $osC_Order->isUseStoreCredit(), 'has_payment_method' => $osC_Order->hasPaymentMethod(), 'enable_store_credit' => $enable_store_credit, 'gift_wrapping' => $osC_Order->_customer['gift_wrapping'] == '1' ? true : false, 'wrapping_message' => $osC_Order->_customer['wrapping_message'], 'billing_address' => str_replace(',', ' ', $osC_Order->getBilling('name')) . ',' . $osC_Order->getBilling('company') . ',' . $osC_Order->getBilling('street_address') . ',' . $osC_Order->getBilling('suburb') . ',' . $osC_Order->getBilling('city') . ',' . $osC_Order->getBilling('postcode') . ',' . $osC_Order->getBilling('state') . ',' . $osC_Order->getBilling('country_title'), 'shipping_address' => str_replace(',', ' ', $osC_Order->getDelivery('name')) . ',' . $osC_Order->getDelivery('company') . ',' . $osC_Order->getDelivery('street_address') . ',' . $osC_Order->getDelivery('suburb') . ',' . $osC_Order->getDelivery('city') . ',' . $osC_Order->getDelivery('postcode') . ',' . $osC_Order->getDelivery('state') . ',' . $osC_Order->getDelivery('country_title'));
     unset($_SESSION['osC_Customer_data']);
     $response = array('success' => true, 'data' => $data);
     echo $toC_Json->encode($response);
 }