Guest User

Untitled

a guest
Dec 23rd, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. public function email_order_user($order_id)
  2. {
  3. // Способ доставки
  4. $delivery = $this->delivery->get_delivery($order->delivery_id);
  5. $this->design->assign('delivery', $delivery);
  6.  
  7. // Способ оплаты
  8. if($order->payment_method_id)
  9. {
  10. $payment_method = $this->payment->get_payment_method($order->payment_method_id);
  11. $this->design->assign('payment', $payment_method);
  12. }
  13.  
  14. $this->design->assign('order', $order);
  15. $this->design->assign('purchases', $purchases);
  16.  
  17. $template = '';
  18.  
  19. if($order->status == 0 && $order->paid == 0) // новый не оплаченный
  20. {
  21. $template = '_new';
  22. }
  23. elseif($order->status == 0 && $order->paid == 1) // новый оплаченный
  24. {
  25. $template = '';
  26. }
  27. elseif($order->status == 1 && $order->paid == 0) // принят не оплаченный
  28. {
  29. $template = '_accepted_not_paid';
  30. }
  31. elseif($order->status == 1 && $order->paid == 1) // принят оплаченный
  32. {
  33. $template = '_accepted_paid';
  34. }
  35. elseif($order->status == 2) // выполнен
  36. {
  37. $template = '_made';
  38. }
  39. elseif($order->status == 3) // удален
  40. {
  41. $template = '_removed';
  42. }
  43.  
  44. // Отправляем письмо
  45. // Если в шаблон не передавалась валюта, передадим
  46. if ($this->design->smarty->getTemplateVars('currency') === null)
  47. {
  48. $this->design->assign('currency', reset($this->money->get_currencies(array('enabled'=>1))));
  49. }
  50. $email_template = $this->design->fetch($this->config->root_dir.'design/'.$this->settings->theme.'/html/email_order'.$template.'.tpl');
  51. $subject = $this->design->get_var('subject');
  52. $this->email($order->email, $subject, $email_template, $this->settings->notify_from_email);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment