Correction d'un bogue sur module OrderStatusNotify
This commit is contained in:
@@ -39,11 +39,20 @@ class OrderStatusListener implements EventSubscriberInterface
|
|||||||
|
|
||||||
$is_order_status_to_notify = OrderStatusNotificationQuery::create()->findOneByOrderStatusId($new_status_id);
|
$is_order_status_to_notify = OrderStatusNotificationQuery::create()->findOneByOrderStatusId($new_status_id);
|
||||||
if (null !== $is_order_status_to_notify) {
|
if (null !== $is_order_status_to_notify) {
|
||||||
|
try {
|
||||||
$new_statut_label = OrderStatusI18nQuery::create()
|
$new_statut_label = OrderStatusI18nQuery::create()
|
||||||
->filterByLocale($order->getLang()->getLocale())
|
->filterByLocale($order->getLang()->getLocale())
|
||||||
->findOneById($new_status_id)
|
->findOneById($new_status_id)
|
||||||
->getTitle();
|
->getTitle();
|
||||||
|
}
|
||||||
|
catch (\Throwable $e) {
|
||||||
|
$new_statut_label = OrderStatusI18nQuery::create()
|
||||||
|
->filterByLocale('fr_FR')
|
||||||
|
->findOneById($new_status_id)
|
||||||
|
->getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $new_statut_label) {
|
||||||
$this->mailer->sendEmailToCustomer(
|
$this->mailer->sendEmailToCustomer(
|
||||||
OrderStatusNotify::MESSAGE_NAME,
|
OrderStatusNotify::MESSAGE_NAME,
|
||||||
$order->getCustomer(),
|
$order->getCustomer(),
|
||||||
@@ -53,6 +62,7 @@ class OrderStatusListener implements EventSubscriberInterface
|
|||||||
'new_status' => $new_statut_label,
|
'new_status' => $new_statut_label,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
}
|
||||||
Tlog::getInstance()->debug("Order status change sent to customer " . $order->getCustomer()->getEmail());
|
Tlog::getInstance()->debug("Order status change sent to customer " . $order->getCustomer()->getEmail());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user