public function process_data() { global $temp_orders_id; $strlen = strlen(get_class($this)); if (isset($_POST[$this->type])) { if (substr($_POST[$this->type], 0, $strlen) == get_class($this)) { if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); } else { tep_db_query('UPDATE temp_orders SET payment_method = "' . $_POST[$this->type] . '", orders_status = "' . $this->instances[$_POST[$this->type]]['order_status_id'] . '", payment_method_extra = "" WHERE orders_id = "' . $temp_orders_id . '"'); } } return true; } else { $this->errors[$this->type] = Translate('Kies a.u.b. een betaalmethode.'); return false; } }
public function process_data() { global $temp_orders_id; if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); tep_db_query('INSERT INTO temp_orders_status_history (orders_id, date_added, customer_notified, comments) VALUES("' . $temp_orders_id . '", NOW(), 0, "' . $_POST[$this->type] . '")'); } else { //check if orders_status_history instance for this order exists $osh_query = tep_db_query('SELECT orders_status_history_id FROM temp_orders_status_history WHERE orders_id = "' . $temp_orders_id . '" ORDER BY orders_status_history_id desc LIMIT 1'); if (tep_db_num_rows($osh_query) > 0) { $osh = tep_db_fetch_array($osh_query); tep_db_query('UPDATE temp_orders_status_history SET comments = "' . $_POST[$this->type] . '", date_added = NOW() WHERE orders_status_history_id = "' . $osh['orders_status_history_id'] . '"'); } else { tep_db_query('INSERT INTO temp_orders_status_history (orders_id, date_added, customer_notified, comments) VALUES("' . $temp_orders_id . '", NOW(), 0, "' . $_POST[$this->type] . '")'); } } return true; }
public function process_data() { global $temp_orders_id, $currencies; $strlen = strlen(get_class($this)); if (isset($_POST[$this->type])) { if (substr($_POST[$this->type], 0, $strlen) == get_class($this)) { if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); } $ot_query = tep_db_query('SELECT orders_total_id FROM temp_orders_total WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); if (tep_db_num_rows($ot_query) > 0) { tep_db_query('UPDATE temp_orders_total SET title="' . $this->instances[$_POST[$this->type]]['title'] . '", text="' . $currencies->display_price($this->instances[$_POST[$this->type]]['quote'], 0) . '", value="' . $this->instances[$_POST[$this->type]]['quote'] . '", sort_order="' . $this->instances[$_POST[$this->type]]['sort_order'] . '" WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); } else { tep_db_query('INSERT INTO temp_orders_total (orders_id, title, text, value, class, sort_order) VALUES ("' . $temp_orders_id . '", "' . $this->instances[$_POST[$this->type]]['title'] . '", "' . $currencies->display_price($this->instances[$_POST[$this->type]]['quote'], 0) . '", "' . $this->instances[$_POST[$this->type]]['quote'] . '", "' . $this->type . '", "' . $this->instances[$_POST[$this->type]]['sort_order'] . '")'); } tep_db_query('UPDATE temp_orders SET shipping_method = "' . $_POST[$this->type] . '" WHERE orders_id = "' . $temp_orders_id . '"'); if (extension_loaded('apc') && ini_get('apc.enabled')) { apc_delete('temp_orders_total_' . $temp_orders_id); } } return true; } else { $this->errors[$this->type] = Translate('Kies a.u.b. een verzendmethode.'); return false; } }
public function process_data() { global $temp_orders_id, $currencies; if (isset($_POST[$this->type])) { if ($_POST[$this->type] == get_class($this)) { if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); } $ot_query = tep_db_query('SELECT orders_total_id FROM temp_orders_total WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); if (tep_db_num_rows($ot_query) > 0) { tep_db_query('UPDATE temp_orders_total SET title="' . $this->config['title'] . '", text="' . $currencies->display_price($this->getQuote(), 0) . '", value="' . $this->getQuote() . '", sort_order="' . $this->config['sort_order'] . '" WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); } else { tep_db_query('INSERT INTO temp_orders_total (orders_id, title, text, value, class, sort_order) VALUES ("' . $temp_orders_id . '", "' . $this->config['title'] . '", "' . $currencies->display_price($this->getQuote(), 0) . '", "' . $this->getQuote() . '", "' . $this->type . '", "' . $this->config['sort_order'] . '")'); } if (isset($_POST[get_class($this) . '_submit']) && $_POST[get_class($this) . '_submit'] == 'search_postcode') { //Search kialo points with postcode return false; } if (!isset($_POST[get_class($this) . '_kp'])) { $this->errors[$this->type] = Translate('Kies a.u.b. een Kiala punt.'); return false; } tep_db_query('UPDATE temp_orders SET shipping_method = "' . $_POST[$this->type] . '", shipping_method_extra = "' . $_POST[get_class($this) . '_kp'] . '" WHERE orders_id = "' . $temp_orders_id . '"'); } if ($temp_orders_id > 0) { $this->temp_data = Checkout::get_all_data_from_temp_db($temp_orders_id); foreach ($this->temp_data[$temp_orders_id]['orders_total'] as $key => $data) { if ($data['class'] == 'order_subtotal') { $this->order_subtotal = $data['value']; } } } return true; } else { $this->errors[$this->type] = Translate('Kies a.u.b. een verzendmethode.'); if ($temp_orders_id > 0) { $this->temp_data = Checkout::get_all_data_from_temp_db($temp_orders_id); foreach ($this->temp_data[$temp_orders_id]['orders_total'] as $key => $data) { if ($data['class'] == 'order_subtotal') { $this->order_subtotal = $data['value']; } } } return false; } }
public function process_data() { global $temp_orders_id, $languages_code, $currency; $strlen = strlen(get_class($this)); if (isset($_POST[$this->type])) { if (substr($_POST[$this->type], 0, $strlen) == get_class($this)) { if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); } tep_db_query('UPDATE temp_orders SET payment_method = "' . $_POST[$this->type] . '", payment_method_extra = "' . $_POST[$this->type . '_paymentmethod'] . '", orders_status = "' . $this->instances[$_POST[$this->type]]['order_status_id'] . '" WHERE orders_id = "' . $temp_orders_id . '"'); if (extension_loaded('apc') && ini_get('apc.enabled')) { apc_delete('temp_order_' . $temp_orders_id); } } return true; } else { $this->errors[$this->type] = Translate('Kies a.u.b. een betaalmethode.'); return false; } }
public function process_data() { global $temp_orders_id, $currencies; if (isset($_POST[$this->type])) { if ($_POST[$this->type] == get_class($this)) { if ($temp_orders_id == 0) { $temp_orders_id = parent::create_order(); } $ot_query = tep_db_query('SELECT orders_total_id FROM temp_orders_total WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); if (tep_db_num_rows($ot_query) > 0) { tep_db_query('UPDATE temp_orders_total SET title="' . $this->config['title'] . '", text="' . $currencies->display_price($this->getQuote(), 0) . '", value="' . $this->getQuote() . '", sort_order="' . $this->config['sort_order'] . '" WHERE orders_id = "' . $temp_orders_id . '" AND class="' . $this->type . '"'); } else { tep_db_query('INSERT INTO temp_orders_total (orders_id, title, text, value, class, sort_order) VALUES ("' . $temp_orders_id . '", "' . $this->config['title'] . '", "' . $currencies->display_price($this->getQuote(), 0) . '", "' . $this->getQuote() . '", "' . $this->type . '", "' . $this->config['sort_order'] . '")'); } if (isset($_POST[get_class($this) . '_submit']) && $_POST[get_class($this) . '_submit'] == 'search_postcode') { //Search Bpost Service points with postcode return false; } if (!isset($_POST[get_class($this) . '_sp'])) { $this->errors[$this->type] = Translate('Kies a.u.b. een Bpost Service punt.'); return false; } if (isset($_POST[get_class($this) . '_postcode']) && !empty($_POST[get_class($this) . '_postcode'])) { $this->xml = $this->convertXMLtoArray(simplexml_load_file('http://taxipost.geo6.be/Locator?Partner=' . $this->config['account_id'] . '&AppId=' . STORE_NAME . '&Function=search&Format=xml&Zone=' . $_POST[get_class($this) . '_postcode'] . '&Language=' . $languages_code . '&Type=' . $this->config['bpost_types'] . '&Limit=' . $this->config['max_sp'])); } else { $this->xml = $this->convertXMLtoArray(simplexml_load_file('http://taxipost.geo6.be/Locator?Partner=' . $this->config['account_id'] . '&AppId=' . STORE_NAME . '&Function=search&Format=xml&Zone=' . $this->temp_data[$temp_orders_id]['orders']['delivery_postcode'] . '&Language=' . $languages_code . '&Type=' . $this->config['bpost_types'] . '&Limit=' . $this->config['max_sp'])); } $type = 1; foreach ($this->xml['PoiList']['Poi'] as $key => $data) { if ($data['Record']['Id'] == $_POST[get_class($this) . '_sp']) { $type = $data['Record']['Type']; } } tep_db_query('UPDATE temp_orders SET shipping_method = "' . $_POST[$this->type] . '", shipping_method_extra = "&Id=' . $_POST[get_class($this) . '_sp'] . '&Type=' . $type . '" WHERE orders_id = "' . $temp_orders_id . '"'); } if ($temp_orders_id > 0) { $this->temp_data = Checkout::get_all_data_from_temp_db($temp_orders_id); foreach ($this->temp_data[$temp_orders_id]['orders_total'] as $key => $data) { if ($data['class'] == 'order_subtotal') { $this->order_subtotal = $data['value']; } } } return true; } else { $this->errors[$this->type] = Translate('Kies a.u.b. een verzendmethode.'); if ($temp_orders_id > 0) { $this->temp_data = Checkout::get_all_data_from_temp_db($temp_orders_id); foreach ($this->temp_data[$temp_orders_id]['orders_total'] as $key => $data) { if ($data['class'] == 'order_subtotal') { $this->order_subtotal = $data['value']; } } } return false; } }