[-] BO : #PSCFV-3039 : Add customer thread when i have a order message
This commit is contained in:
@@ -483,6 +483,27 @@ abstract class PaymentModuleCore extends Module
|
||||
$message = new Message((int)$old_message['id_message']);
|
||||
$message->id_order = (int)$order->id;
|
||||
$message->update();
|
||||
|
||||
// Add this message in the customer thread
|
||||
$customer_thread = new CustomerThread();
|
||||
$customer_thread->id_contact = 0;
|
||||
$customer_thread->id_customer = (int)$order->id_customer;
|
||||
$customer_thread->id_shop = (int)$this->context->shop->id;
|
||||
$customer_thread->id_order = (int)$order->id;
|
||||
$customer_thread->id_lang = (int)$this->context->language->id;
|
||||
$customer_thread->email = $customer->email;
|
||||
$customer_thread->status = 'open';
|
||||
$customer_thread->token = Tools::passwdGen(12);
|
||||
$customer_thread->add();
|
||||
|
||||
$customer_message = new CustomerMessage();
|
||||
$customer_message->id_customer_thread = $customer_thread->id;
|
||||
$customer_message->id_employee = 0;
|
||||
$customer_message->message = htmlentities($message->message, ENT_COMPAT, 'UTF-8');
|
||||
$customer_message->private = 0;
|
||||
|
||||
if (!$customer_message->add())
|
||||
$this->errors[] = Tools::displayError('An error occurred while saving message');
|
||||
}
|
||||
|
||||
// Hook validate order
|
||||
|
||||
@@ -2995,6 +2995,7 @@ $_LANGADM['AdminReturn694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité';
|
||||
$_LANGADM['AdminReturn853ae90f0351324bd73ea615e6487517'] = ' :';
|
||||
$_LANGADM['AdminReturn9442975514755961788cc54bf8b43ddf'] = 'Options des retours produits';
|
||||
$_LANGADM['AdminReturn97b920aeb6427541616bdfb89a42be02'] = 'Nombre de jours :';
|
||||
$_LANGADM['AdminReturn9ea67be453eaccf020697b4654fc021a'] = 'Sauvegarder et rester';
|
||||
$_LANGADM['AdminReturna8658715e6b0e879cbcbc4728a423b36'] = 'Texte n°%d';
|
||||
$_LANGADM['AdminReturnb52b44c9d23e141b067d7e83b44bb556'] = 'Produits :';
|
||||
$_LANGADM['AdminReturnb5ae76d7ccb124762ecb8452378ebe8c'] = 'Activer ou désactiver la prise en charge des retours produits';
|
||||
@@ -3649,6 +3650,7 @@ $_LANGADM['AdminStorese734ed12d2c2026532f66e0ebeedfc8c'] = 'Exemple : 10h00-21h3
|
||||
$_LANGADM['AdminStorese93c33bd1341ab74195430daeb63db13'] = 'Nom de la boutique :';
|
||||
$_LANGADM['AdminStoresec53a8c4f07baed5d8825072c89799be'] = 'État';
|
||||
$_LANGADM['AdminStoresede4759c9afae620fd586628789fa304'] = 'Activer la sélection';
|
||||
$_LANGADM['AdminStoresf16b5952df8d25ea30b25ff95ee8fedf'] = 'Boutiques associées :';
|
||||
$_LANGADM['AdminStoresf2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_LANGADM['AdminStoresfe370c96885df78dd3123a1779bd6a26'] = 'Coordonnées du magasin, ex. : 45.265469 / -47.226478';
|
||||
$_LANGADM['AdminStoresffea2d321be109fc7243cfeb515fe257'] = 'Choisissez votre état/région (si cela s\'applique)';
|
||||
|
||||
Reference in New Issue
Block a user