change message in mail order_conf

This commit is contained in:
Marion Muszynski 2017-01-11 18:02:31 +01:00
parent 80e0bffe4f
commit 262cac694a
2 changed files with 62 additions and 12 deletions

View File

@ -99,7 +99,7 @@
<td align="left">
{delivery_date}
<br />
Vous recevrez un email contenant le num&eacute;ro de suivi du colis 48h avant.
{delivery_desc}
</td>
</tr>
<tr><td>&nbsp;</td></tr>

View File

@ -361,6 +361,30 @@
$invoice = new Address((int)($order->id_address_invoice));
$delivery = new Address((int)($order->id_address_delivery));
$carrier = new Carrier((int)($order->id_carrier), $order->id_lang);
/**
* #Override Antadis - Mondiale relay - Socol
*/
$_tr_delivery_desc = array(
2 => array(
'MR' => '<p>Votre colis sera livré <strong>chez un commerçant</strong> du réseau Mondial Relay. Vous serez prévenu de la mise à disposition de votre colis par e-mail. Vous disposez alors de 10 jours ouvrables pour le récupérer. Passé ce délai, il nous sera automatiquement retourné.</p>',
'SOCOL_OOH' => '<p>Vous serez prévenu de la mise à disposition de votre colis par e-mail. Vous disposez alors de 10 jours ouvrables pour le récupérer. Passé ce délai, il nous sera automatiquement retourné.<p>',
'DOM' => '<p>Vos produits vous seront remis en main propre <strong>à ladresse de votre commande</strong>. Vous recevrez un email contenant le numéro de suivi du colis 48h avant. En cas dabsence, votre colis sera déposé dans votre boîte aux lettres si son volume le permet.<br/>Dans le cas contraire, un avis de passage vous sera remis. Vous disposez alors de 10 jours ouvrables pour retirer votre colis dans votre bureau de poste. Passé ce délai, celui-ci nous sera automatiquement renvoyé. Et nous vous contacterons.</p>',
),
3 => array(
'DOM' => '<p>Recibirás un email con el número de seguimiento de tu pedido 48h antes.</p>',
)
);
if ($carrier->id == (int)Configuration::get('ANT_CARRIER_DOM') || $carrier->id == (int)Configuration::get('ANT_CARRIER_DROP')) {
$delivery_carrier = 'DOM';
} elseif (in_array($carrier->id, array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_SOCOL'))))) {
$delivery_carrier = 'SOCOL_OOH';
} elseif (in_array($carrier->id, array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_MR'))))) {
$delivery_carrier = 'MR';
} else {
$delivery_carrier = 'DOM'
}
$delivery_state = $delivery->id_state ? new State((int)($delivery->id_state)) : false;
$invoice_state = $invoice->id_state ? new State((int)($invoice->id_state)) : false;
// $date = new DateTime();
@ -382,16 +406,41 @@
$params = array('id_order' => $order->id, 'id_lang' => $cookie->id_lang);
$delivery_date = Module::hookExec('deliveryDelay', $params);
// @Override Mondial relay delivery
if ($mr = Db::getInstance()->getRow('
SELECT s.*, c.`id_country`
FROM `' . _DB_PREFIX_ . 'mr_selected` s
LEFT JOIN `' . _DB_PREFIX_ . 'mr_method` m
ON m.`id_mr_method` = s.`id_method`
LEFT JOIN `' . _DB_PREFIX_ . 'country` c
ON c.`iso_code` = s.`MR_Selected_Pays`
WHERE m.`id_carrier` = ' . (int) $carrier->id . '
AND s.`id_cart` = ' . (int) $order->id_cart . '
AND m.`id_mr_method` IS NOT NULL
')) {
$delivery->firstname = $mr['MR_Selected_LgAdr1'];
$delivery->lastname = $mr['MR_Selected_LgAdr2'];
$delivery->address1 = $mr['MR_Selected_LgAdr3'];
$delivery->address2 = $mr['MR_Selected_LgAdr4'];
$delivery->postcode = $mr['MR_Selected_CP'];
$delivery->city = $mr['MR_Selected_Ville'];
$delivery->id_country = isset($mr['id_country']) && $mr['id_country'] ? (int) $mr['id_country'] : 8;
}
$delivery_block_html = $this->_getFormatedAddress(
$delivery,
"<br />",
array(
'firstname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>',
'lastname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>')
);
$data = array(
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{email}' => $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="color:#DB3484; font-weight:bold;">%s</span>',
'lastname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>')),
'{delivery_block_html}' => $delivery_block_html,
'{invoice_block_html}' => $this->_getFormatedAddress($invoice, "<br />",
array(
'firstname' => '<span style="color:#DB3484; font-weight:bold;">%s</span>',
@ -430,7 +479,8 @@
'{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false),
'{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false),
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false)
'{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false),
'{delivery_desc}' => $_tr_delivery_desc[(int) $cart->id_lang][$delivery_carrier]
);
if (is_array($extraVars))