0
在哪些類中,我可以找到PrestaShop中電子郵件模板的所有變量?
我的意思是像{firstname}或{lastname}。或者,也許它依賴於類方法。例如。如果我創建新的付款模板,那麼我需要去PaymentModule.php?感謝幫助。我可以在Prestashop 1.6中找到電子郵件模板的所有變量
親切的問候
在哪些類中,我可以找到PrestaShop中電子郵件模板的所有變量?
我的意思是像{firstname}或{lastname}。或者,也許它依賴於類方法。例如。如果我創建新的付款模板,那麼我需要去PaymentModule.php?感謝幫助。我可以在Prestashop 1.6中找到電子郵件模板的所有變量
親切的問候
正如我在評論說,這取決於通過發送電子郵件的方法。如果您想創建新的付款模板,則必須查看PaymentModule.php
並檢查ValidateOrder
方法。
這是您可以在電子郵件模板中使用的所有瓦爾:
$data = array(
'{firstname}' => $this->context->customer->firstname,
'{lastname}' => $this->context->customer->lastname,
'{email}' => $this->context->customer->email,
'{delivery_block_txt}' => $this->_getFormatedAddress($delivery, "\n"),
'{invoice_block_txt}' => $this->_getFormatedAddress($invoice, "\n"),
'{delivery_block_html}' => $this->_getFormatedAddress($delivery, '<br />', array(
'firstname' => '<span style="font-weight:bold;">%s</span>',
'lastname' => '<span style="font-weight:bold;">%s</span>'
)),
'{invoice_block_html}' => $this->_getFormatedAddress($invoice, '<br />', array(
'firstname' => '<span style="font-weight:bold;">%s</span>',
'lastname' => '<span style="font-weight:bold;">%s</span>'
)),
'{delivery_company}' => $delivery->company,
'{delivery_firstname}' => $delivery->firstname,
'{delivery_lastname}' => $delivery->lastname,
'{delivery_address1}' => $delivery->address1,
'{delivery_address2}' => $delivery->address2,
'{delivery_city}' => $delivery->city,
'{delivery_postal_code}' => $delivery->postcode,
'{delivery_country}' => $delivery->country,
'{delivery_state}' => $delivery->id_state ? $delivery_state->name : '',
'{delivery_phone}' => ($delivery->phone) ? $delivery->phone : $delivery->phone_mobile,
'{delivery_other}' => $delivery->other,
'{invoice_company}' => $invoice->company,
'{invoice_vat_number}' => $invoice->vat_number,
'{invoice_firstname}' => $invoice->firstname,
'{invoice_lastname}' => $invoice->lastname,
'{invoice_address2}' => $invoice->address2,
'{invoice_address1}' => $invoice->address1,
'{invoice_city}' => $invoice->city,
'{invoice_postal_code}' => $invoice->postcode,
'{invoice_country}' => $invoice->country,
'{invoice_state}' => $invoice->id_state ? $invoice_state->name : '',
'{invoice_phone}' => ($invoice->phone) ? $invoice->phone : $invoice->phone_mobile,
'{invoice_other}' => $invoice->other,
'{order_name}' => $order->getUniqReference(),
'{date}' => Tools::displayDate(date('Y-m-d H:i:s'), null, 1),
'{carrier}' => ($virtual_product || !isset($carrier->name)) ? Tools::displayError('No carrier') : $carrier->name,
'{payment}' => Tools::substr($order->payment, 0, 32),
'{products}' => $product_list_html,
'{products_txt}' => $product_list_txt,
'{discounts}' => $cart_rules_list_html,
'{discounts_txt}' => $cart_rules_list_txt,
'{total_paid}' => Tools::displayPrice($order->total_paid, $this->context->currency, false),
'{total_products}' => Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $order->total_products : $order->total_products_wt, $this->context->currency, false),
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false),
'{total_tax_paid}' => Tools::displayPrice(($order->total_products_wt - $order->total_products) + ($order->total_shipping_tax_incl - $order->total_shipping_tax_excl), $this->context->currency, false));
如果您要創建一個新的模塊,你可以通過所有你需要的增值經銷商「覆蓋」的ValidateOrder
方法,
不,我不知道。我想知道,我可以使用哪些變量來創建電子郵件模板。例如{firstname}。 – aviaPL
您可以創建變量並傳遞給'Mail :: Send'函數。這是你需要的嗎? :) – idnovate
我錯了?我說英語不好?也許我會用另一個詞。我想修改一些模板電子郵件。問題是。在哪裏可以找到模板的變量?這是所有.. – aviaPL