Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <file name="admin/controller/sale/order.php">
- <operation>
- <search position="before"><![CDATA[$this->model_sale_order->addOrderHistory($this->request->get['order_id'], $this->request->post);]]></search>
- <add>
- <![CDATA[
- if ($this->request->post['notify_sms']) {
- $order_info = $this->model_sale_order->getOrder($this->request->get['order_id']);
- $order_id = $this->request->get['order_id'];
- if ($order_info['order_status_id'] != $this->request->post['order_status_id'] || $this->request->post['notify_sms_comment']) {
- $fullitems_query = $this->db->query("SELECT GROUP_CONCAT(' ', `name`, ' (', `quantity`, ')') as `fullitems`,
- GROUP_CONCAT(' ', `model`, ' (', `quantity`, ')') as `liteitems`
- FROM `" . DB_PREFIX . "order_product` where `order_id` = " . (int)$order_id);
- $order_info['fullitems'] = $fullitems_query->row['fullitems'];
- $order_info['liteitems'] = $fullitems_query->row['liteitems'];
- $order_info['sumreal'] = $this->currency->format(floatval($order_info['total']), $order_info['currency_code'], $order_info['currency_value']);
- // $order_info['sum'] = $this->currency->format(floatval($order_info['total']));
- $ext = array(
- 'order_info' => $order_info,
- 'config_sms_alert_client' => 0,
- 'config_sms_alert_admin' => 1
- );
- $options = array(
- 'to' => $order_info['telephone'],
- 'copy' => '',
- 'from' => $this->config->get('config_sms_from'),
- 'login' => $this->config->get('config_sms_gate_username'),
- 'password' => $this->config->get('config_sms_gate_password'),
- 'message' => str_replace(array('{ID}', '{DATE}', '{TIME}', '{SUM}', '{PHONE}', '{STATUS}'),
- array($this->request->get['order_id'], date('d.m.Y'), date('H:i'), floatval($order_info['total']), $order_info['telephone'],
- $this->model_sale_order->getStatusName($this->request->post['order_status_id'])),
- $this->config->get('config_sms_message2status')),
- 'ext' => $ext
- );
- if($this->request->post['notify_sms_comment']) $options['message'] = str_replace('{COMMENT}', $this->request->post['comment'], $options['message']);
- else $options['message'] = str_replace('{COMMENT}', '', $options['message']);
- $this->load->library('sms');
- $sms = new Sms($this->config->get('config_sms_gatename'), $options);
- $sms->send();
- }
- }
- ]]>
- </add>
- </operation>
- </file>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement