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!

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

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据