Jump to content
  • 0

Zmienne z "Order_conf" w "bankwire", emaile do klientów.


Fertechpl

Question

Witam!

 

Mam problem z wykorzystaniem zmiennych {products},{date},{delivery_address} ect. itp. które są dostępne w szablonie e-mailu "order_conf", a nie pobierają się do e-maila z modułu "bankwire". Wie może ktoś jak udostępnić dane zmienne z "order_conf" dla innych szablonów e-mail?

 

 

Pozdrawiam!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

do order_conf te dane przekazywane sa z glownego kontrolera sklepu, jak dobrze pamietam paymentModule.php jezeli chodzi o moduly, typu bankwre czy inne, te maja wlasne kontroelry, wiec te dane musialbys tam dopisac wraz z wyslaniem ich do danego maila, lub przekonstruowac sam modul glowny payment i w nim dodac implementacje tych zmiennych do innych szablonow maili niz tylko order_conf

Link to comment
Share on other sites

  • 0

Jeżeli dobrze dedukuję ten kod jest odpowiedzialny zarówno za wysłanie samego e-maila jak i przekazywanie zmiennych.
Nie rozumiem tylko jak przekazać dane zmienne dla bankwire...

 

Nie umiem też znaleźć kontrolera dla e-maila od bankwire... ani payment.php, ani bankwire.php zdają się nie mieć wpływu na wysyłkę danych e-maili...


PaymentModule.php

 

// Send an e-mail to customer (one order = one email)
					if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id)
					{
						$invoice = new Address($order->id_address_invoice);
						$delivery = new Address($order->id_address_delivery);
						$delivery_state = $delivery->id_state ? new State($delivery->id_state) : false;
						$invoice_state = $invoice->id_state ? new State($invoice->id_state) : false;

						$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($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $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));

						if (is_array($extra_vars))
							$data = array_merge($data, $extra_vars);

						// Join PDF invoice
						if ((int)Configuration::get('PS_INVOICE') && $order_status->invoice && $order->invoice_number)
						{
							$pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $this->context->smarty);
							$file_attachement['content'] = $pdf->render(false);
							$file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf';
							$file_attachement['mime'] = 'application/pdf';
						}
						else
							$file_attachement = null;

						if (self::DEBUG_MODE)
							PrestaShopLogger::addLog('PaymentModule::validateOrder - Mail is about to be sent', 1, null, 'Cart', (int)$id_cart, true);

						if (Validate::isEmail($this->context->customer->email))
							Mail::Send(
								(int)$order->id_lang,
								'order_conf',
								Mail::l('Order confirmation', (int)$order->id_lang),
								$data,
								$this->context->customer->email,
								$this->context->customer->firstname.' '.$this->context->customer->lastname,
								null,
								null,
								$file_attachement,
								null, _PS_MAIL_DIR_, false, (int)$order->id_shop
							);
					}

Pozdrawiam!

Edited by Fertechpl (see edit history)
Link to comment
Share on other sites

  • 0

Niestety nie widzę tego (postProcess widzę, ale nie udaje mi się przekazać zmiennych ;) ). W każdym razie dzięki za podpowiedź.

 

Co ciekawe na różnych forach też nie znalazłem na to odpowiedzi.

 

Udało mi się uzyskać pojedyncze zmienne takie jak nazwa produktu. 

 

$products = $cart->getProducts();$names = '';foreach($products AS $product){    $names = $names . $product['name'] . '\r\n';}

'{bankwire_products}' => $names,

O {products} z listą produktów mogę na razie zapomnieć.


 

 

 

Pozdrawiam!

Edited by Fertechpl (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...