duanliangman5398 2014-08-01 15:54
浏览 42
已采纳

Opencart将奖励积分添加到客户的订单电子邮件中

When a customer places an order I'm trying to add in the rewards points they've earned to their order email.

I know the email for the reward points is sent from /admin/model/sale/customer.php so when I update a customer's reward points manually it mails them with the correct information.

And the email for the order is: /catalog/model/checkout/order.php

So I just need to get the information the admin file gets and add it into the order.

I've added the appropriate information into the order.tpl and I've added the following into the /model/sale/order.php:

$template->data['rewardpoints'] = "";

I just now need to put something in place of the quotes and return the reward points the customer has earned.

Ideally how much points the customer earned for this purchase and how much they have in total, but failing that just the points they have in total will suffice.

Anyone any ideas?

Hope that's clear enough.

-James

  • 写回答

1条回答 默认 最新

  • doude1917 2014-08-02 20:18
    关注

    First, you have to create a simple VQMod, which will add reward points to corresponding controller/model (checkout/order in your case). And only then you can add 'rewardpoints' value to template.

    Get reward points for particular order from model:

    $this->load->model('sale/customer');
    $rewardpoints = $this->model->getTotalCustomerRewardsByOrderId($order_id);
    

    Assign the value in controller:

    $template->data['rewardpoints'] = $rewardpoints;
    

    Add it to template:

    echo "You got ".$rewardpoints."points, mon!";
    

    Booya!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料