1

我正在尝试修改 OpenCart 的 order.tpl,catalog/view/theme/default/template/mail/order.tpl因此电子邮件中的内容如下:

Hello (firstname)!

Welcome to my store... etc.

我认为这与以下内容有关:

<p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>

但我猜我需要在$text_greeting. 不幸的是,我不熟悉 php。

希望有人可以帮助我。


更多信息:

似乎我需要从数据库中加载一个新值,即将“名字”加载到当前位于数据库中的目录/视图/主题/默认/模板/邮件/订单.tpl 中。

我真的不了解 php,所以我会感谢任何了解 opencart 和 php 的人来帮助我。

谢谢

4

1 回答 1

2

好的,这应该是一个干净的解决方案,可以直接将您带到您需要的地方:

1.编辑catalog/language/<YOUR_LANGUAGE>/mail/order.php行前的and(英文):

$_['text_new_greeting']         = 'Thank you for your interest in %s products. Your order has been received and will be processed once payment has been confirmed.';

添加这个

$_['text_title']                = 'Hello %s,';

2.打开catalog/model/checkout/order.php-搜索方法confirm(),然后找到行

$template->data['text_greeting'] = sprintf($language->get('text_new_greeting'), html_entity_decode($order_info['store_name'], ENT_QUOTES, 'UTF-8'));

在它添加这个之前:

$template->data['text_title'] = sprintf($language->get('text_titler'), html_entity_decode($order_info['payment_firstname'], ENT_QUOTES, 'UTF-8'));

我只想提一下,这应该做两次——一次用于 HTML 模板部分,一次用于 TEXT 模板部分(向下滚动一点用于 TEXT tpl 部分)。

3.打开catalog/view/theme/<YOUR_THEME>/template/mail/order.tpl并找到该行:

<p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_greeting; ?></p>

在它添加这个之前:

<p style="margin-top: 0px; margin-bottom: 20px;"><?php echo $text_title; ?></p>

现在你应该完成了。

于 2013-10-02T08:41:16.940 回答