Advertisement
Guest User

Untitled

a guest
Apr 17th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. <file name="admin/controller/sale/order.php">
  2. <operation>
  3. <search position="before"><![CDATA[$this->model_sale_order->addOrderHistory($this->request->get['order_id'], $this->request->post);]]></search>
  4. <add>
  5. <![CDATA[
  6. if ($this->request->post['notify_sms']) {
  7.  
  8. $order_info = $this->model_sale_order->getOrder($this->request->get['order_id']);
  9. $order_id = $this->request->get['order_id'];
  10.  
  11. if ($order_info['order_status_id'] != $this->request->post['order_status_id'] || $this->request->post['notify_sms_comment']) {
  12.  
  13. $fullitems_query = $this->db->query("SELECT GROUP_CONCAT(' ', `name`, ' (', `quantity`, ')') as `fullitems`,
  14. GROUP_CONCAT(' ', `model`, ' (', `quantity`, ')') as `liteitems`
  15. FROM `" . DB_PREFIX . "order_product` where `order_id` = " . (int)$order_id);
  16. $order_info['fullitems'] = $fullitems_query->row['fullitems'];
  17. $order_info['liteitems'] = $fullitems_query->row['liteitems'];
  18.  
  19. $order_info['sumreal'] = $this->currency->format(floatval($order_info['total']), $order_info['currency_code'], $order_info['currency_value']);
  20. // $order_info['sum'] = $this->currency->format(floatval($order_info['total']));
  21.  
  22. $ext = array(
  23. 'order_info' => $order_info,
  24. 'config_sms_alert_client' => 0,
  25. 'config_sms_alert_admin' => 1
  26. );
  27.  
  28. $options = array(
  29. 'to' => $order_info['telephone'],
  30. 'copy' => '',
  31. 'from' => $this->config->get('config_sms_from'),
  32. 'login' => $this->config->get('config_sms_gate_username'),
  33. 'password' => $this->config->get('config_sms_gate_password'),
  34. 'message' => str_replace(array('{ID}', '{DATE}', '{TIME}', '{SUM}', '{PHONE}', '{STATUS}'),
  35. array($this->request->get['order_id'], date('d.m.Y'), date('H:i'), floatval($order_info['total']), $order_info['telephone'],
  36. $this->model_sale_order->getStatusName($this->request->post['order_status_id'])),
  37. $this->config->get('config_sms_message2status')),
  38. 'ext' => $ext
  39. );
  40.  
  41. if($this->request->post['notify_sms_comment']) $options['message'] = str_replace('{COMMENT}', $this->request->post['comment'], $options['message']);
  42. else $options['message'] = str_replace('{COMMENT}', '', $options['message']);
  43.  
  44. $this->load->library('sms');
  45.  
  46. $sms = new Sms($this->config->get('config_sms_gatename'), $options);
  47. $sms->send();
  48.  
  49. }
  50. }
  51. ]]>
  52. </add>
  53. </operation>
  54. </file>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement