Преглед на файлове

Email confirmation de commande : ajout informations du point de vente (horaires etc.)

feature/rotating_product
Guillaume Bourgeois преди 6 месеца
родител
ревизия
154619bd20
променени са 3 файла, в които са добавени 20 реда и са изтрити 7 реда
  1. +14
    -6
      common/mail/orderConfirm-html.php
  2. +5
    -0
      domain/PointSale/PointSale/PointSaleSolver.php
  3. +1
    -1
      producer/controllers/OrderController.php

+ 14
- 6
common/mail/orderConfirm-html.php Целия файл

@@ -38,13 +38,14 @@ termes.

use domain\Order\Order\Order;
use domain\Order\Order\OrderModule;
use domain\Producer\Producer\ProducerModule;
use domain\PointSale\PointSale\PointSaleModule;use domain\Producer\Producer\ProducerModule;
use domain\User\User\UserModule;
use yii\helpers\Html;

$producerModule = ProducerModule::getInstance();
$orderModule = OrderModule::getInstance();
$userModule = UserModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

?>

@@ -60,23 +61,30 @@ $userModule = UserModule::getInstance();
<?php if($order->pointSale->is_bread_box && $order->pointSale->bread_box_code): ?>
(Code : <strong><?= $order->pointSale->bread_box_code; ?></strong>)
<?php endif; ?>
<?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.</p>
<?php if(strlen($pointSale->locality) > 0): ?> situé à <?= Html::encode($pointSale->locality) ?><?php endif ?>.
</p>

<?php if($order->user && !$userModule->getSolver()->isTypeGuest($order->user)): ?>
<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 $infosPointSale = $pointSaleModule->getSolver()->getStrInfosByDistribution($pointSale, $distribution); ?>
<?php if(strlen($infosPointSale)): ?>
<strong>Informations pratiques</strong><br />
<?= $infosPointSale ?>
<?php endif; ?>

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

<?php $order_infos = $producerModule->getConfig('order_infos') ; ?>
<?php if($order_infos && strlen($order_infos) > 0): ?>
<p><strong>Informations générales :</strong><br />
<p><strong>Informations générales</strong><br />
<?= nl2br(Html::encode($order_infos)); ?></p>
<?php endif; ?>

<?php if($order->user && !$userModule->getSolver()->isTypeGuest($order->user)): ?>
<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 endif; ?>

À bientôt,<br />
<?= Html::encode($producer->name); ?>

+ 5
- 0
domain/PointSale/PointSale/PointSaleSolver.php Целия файл

@@ -105,6 +105,11 @@ class PointSaleSolver extends AbstractService implements SolverInterface
return $str;
}

public function getStrInfosByDistribution(PointSale $pointSale, Distribution $distribution): string
{
return $this->getStrInfos($pointSale, strtolower(date('l', strtotime($distribution->date))));
}

public function getLocalityWithAddressTooltip(PointSale $pointSale): string
{
$html = '<span class="locality">';

+ 1
- 1
producer/controllers/OrderController.php Целия файл

@@ -862,7 +862,7 @@ class OrderController extends ProducerBaseController
'id_point_sale' => $pointSale['id']
]);

$pointSale['infos'] = $pointSaleModule->getStrInfos($pointSaleObject, strtolower(date('l', strtotime($distribution->date))));
$pointSale['infos'] = $pointSaleModule->getSolver()->getStrInfosByDistribution($pointSaleObject, $distribution);
}

$pointSale['position'] = $position;

Loading…
Отказ
Запис