2017-09-05 4 views
0

PrestaShopで電子メールテンプレートのすべての変数をどのクラスで見つけることができますか?
{firstname}や{lastname}のような意味です。あるいは、それはクラスメソッドによって異なるかもしれません。例えば。新しい支払いテンプレートを作成すると、PaymentModule.phpに移動する必要がありますか?手伝ってくれてありがとう。Prestashop 1.6で電子メールテンプレートのすべての変数を見つけることができます

種類は、私がコメントで言うように、それは電子メールを送信する方法により異なり

+0

いいえ、ありません。私は、電子メールテンプレートを作成するためにどのような変数を使用できるかを知りたい。例えば{firstname}です。 – aviaPL

+0

変数を作成し、 'Mail :: Send'関数に渡すことができます。これはあなたが必要とするものですか? :) – idnovate

+0

私は間違っていた?私は英語が悪いですか?たぶん私は別の言葉を使うでしょう。私はいくつかのテンプレートの電子メールを変更したい。質問は。どこでテンプレートの変数を見つけることができますか?それはすべて.. – aviaPL

答えて

0

について。新しい支払いテンプレートを作成する場合は、PaymentModule.phpを表示し、ValidateOrderメソッドを確認する必要があります。 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)); 

あなたは新しいモジュールを作成している場合は、あなたが必要とするすべてのVARSを渡すことができ、:
これは、あなたの電子メールテンプレートで使用できるすべてのVARSです

関連する問題