Email Prestashop 1.6添加产品&x27;邮件模板中的制造商名称
我想在新订单电子邮件中添加产品的制造商名称。客户端和管理端 因此,我尝试编辑/mails/fr/order\u conf\u product\u list.tpl文件,添加一个新的单元格,其中包含 {$product['manufacturer_name']} 但是没有机会 我已经尝试了论坛上的一些技巧,比如下面的,但是手机一直空着 任何帮助都将不胜感激Email Prestashop 1.6添加产品&x27;邮件模板中的制造商名称,email,templates,smarty,prestashop,prestashop-1.6,Email,Templates,Smarty,Prestashop,Prestashop 1.6,我想在新订单电子邮件中添加产品的制造商名称。客户端和管理端 因此,我尝试编辑/mails/fr/order\u conf\u product\u list.tpl文件,添加一个新的单元格,其中包含 {$product['manufacturer_name']} 但是没有机会 我已经尝试了论坛上的一些技巧,比如下面的,但是手机一直空着 任何帮助都将不胜感激 非常感谢。要实现此操作,您需要在添加变量制造商之前 对于您的测试,您可以编辑文件[your_shop]/classes/PaymentMod
非常感谢。要实现此操作,您需要在添加变量制造商之前 对于您的测试,您可以编辑文件[your_shop]/classes/PaymentModule.php(但更好的解决方案是使用override): 1-保留制造商对象 2-在product_var_tpl中添加制造商对象
foreach ($order->product_list as $product) {
$manufacturer = new Manufacturer((int)$product['id_manufacturer']);
****
$product_var_tpl = array(
'manufacturer' => $manufacturer,
'reference' => $product['reference'],
'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''),
'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false),
'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false),
'quantity' => $product['quantity'],
'customization' => array()
);
}
在您的文件/mails/fr/order\u conf\u product\u list.tpl中
您可以使用对象“制造商”
{$product['manufacturer']->name}
如@timactive所述,在客户邮件中获取制造商名称的解决方案是编辑PaymentModule.php 因此,要在客户邮件中获得制造商的名称: PaymentModule.php:
foreach ($order->product_list as $product) {
$manufacturer = new Manufacturer((int)$product['id_manufacturer']);
$product_var_tpl = array(
'reference' => $product['reference'],
'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''),
'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false),
'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false),
'quantity' => $product['quantity'],
'customization' => array(),
'manufacturer' => $manufacturer->name
);
在order_conf_product_list.html中,调用product对象,如下所示:
{$product['manufacturer']}
这是解决方案的一部分,因为我也想在管理新订单邮件中添加制造商的名称
在管理员新订单邮件中添加制造商名称:
要完成此操作,我必须像这样编辑MailAlert模块:
{$product['manufacturer']}
在mailalert.php中,在函数“hookActionValidateOrder”中:
foreach($products as$key=>$product)
{
$manufacturer=新制造商($product['id\u manufacturer'],$id\u lang);
$items\u表=
'
“.$product['product_reference']”
“.$manufacturer->name”
'
(isset($product['attributes\u small'])?“”。$product['attributes\u small']:“”)
.(!empty($customization_text)“
”。$customization_text:”)
.
“.Tools::displayPrice($unit_price,$currency,false)。”
“.(int)$product[‘product_数量’]”
'
.Tools::displayPrice($unit_price*$product['product_quantity']),$currency,false)
.'
';
现在,要创建to cell,请转到mailalert/mails/fr/new-order.html并在第114行周围添加以下行:
<th style="border:1px solid #D6D4D4;background-color:#fbfbfb;font-family:Arial;color:#333;font-size:13px;padding:10px">Marque</th>
品牌
Hi Adrien,你测试过解决方案吗?嗨,谢谢!我尝试过你的解决方案。它不起作用,但让我解决了我的问题。事实上,你必须注明$product['manufacturer]->名称,我编辑我的答案;-)。