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 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条