Pārlūkot izejas kodu

[Boutique] Commander : email de confirmation lors d'une modification de commande #1421

feature/souke
Guillaume Bourgeois pirms 1 gada
vecāks
revīzija
9f03c3ca20
2 mainītis faili ar 34 papildinājumiem un 34 dzēšanām
  1. +2
    -0
      common/mail/orderConfirm-html.php
  2. +32
    -34
      producer/controllers/OrderController.php

+ 2
- 0
common/mail/orderConfirm-html.php Parādīt failu

@@ -60,6 +60,8 @@ $orderModule = OrderModule::getInstance();
<?php endif; ?>
<?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p>

<p>Retrouvez à tout moment votre commande dans l'espace de votre producteur via l'onglet <a href="<?= Yii::$app->urlManager->createAbsoluteUrl('order/history') ?>">Mes commandes</a>.</p>

<?php $payment_infos = $producerModule->getConfig('option_payment_info') ; ?>
<?php if($payment_infos && strlen($payment_infos) > 0): ?>
<p><strong>Informations de paiement :</strong><br />

+ 32
- 34
producer/controllers/OrderController.php Parādīt failu

@@ -476,44 +476,42 @@ class OrderController extends ProducerBaseController
/*
* Envoi email de confirmation
*/
if ($isNewOrder) {

$emailSubject = 'Confirmation de commande';
$emailContentParams = [
'order' => $order,
'pointSale' => $pointSale,
'distribution' => $distribution,
'user' => $user,
'producer' => $producer
];

// au client
if ($producerModule->getConfig('option_email_confirm')) {
\Yii::$app->mailerService->sendFromProducer(
$emailSubject,
'orderConfirm',
$emailContentParams,
$user->email,
$producer
);
$emailSubject = 'Confirmation de commande';
$emailContentParams = [
'order' => $order,
'pointSale' => $pointSale,
'distribution' => $distribution,
'user' => $user,
'producer' => $producer
];

}
// au client
if ($producerModule->getConfig('option_email_confirm')) {
\Yii::$app->mailerService->sendFromProducer(
$emailSubject,
'orderConfirm',
$emailContentParams,
$user->email,
$producer
);

// au producteur
$contactProducer = $producerModule->getMainContact($producer);
if ($producerModule->getConfig('option_email_confirm_producer') && $contactProducer && strlen(
$contactProducer->email
)) {

\Yii::$app->mailerService->sendFromSite(
$emailSubject,
'orderConfirmProducer',
$emailContentParams,
$contactProducer->email
);
}
}

// au producteur
$contactProducer = $producerModule->getMainContact($producer);
if ($producerModule->getConfig('option_email_confirm_producer') && $contactProducer && strlen(
$contactProducer->email
)) {

\Yii::$app->mailerService->sendFromSite(
$emailSubject,
'orderConfirmProducer',
$emailContentParams,
$contactProducer->email
);
}


$order = $orderModule->findOneOrderById($order->id);
$orderModule->initOrder($order);
$orderModule->updateOrderTillerSynchronization($order);

Notiek ielāde…
Atcelt
Saglabāt