Correction d'un bogue dans l'envoi de mail ColissimoWs + finalisation module DHL

This commit is contained in:
2020-12-07 22:01:54 +01:00
parent c388c942b5
commit 40b78b9a63
4 changed files with 14 additions and 12 deletions

View File

@@ -361,8 +361,7 @@ class Order extends BaseOrder
{
if (is_array($statusCode)) {
return in_array($this->getOrderStatus()->getCode(), $statusCode);
} else {
return $this->getOrderStatus()->getCode() == $statusCode;
} else {return $this->getOrderStatus()->getCode() == $statusCode;
}
}
}

View File

@@ -53,7 +53,10 @@ class ShippingNotificationSender extends BaseAction implements EventSubscriberIn
*/
public function sendShippingNotification(OrderEvent $event)
{
if ($event->getOrder()->isSent()) {
$order = $event->getOrder();
$module = new ColissimoWs();
if ($event->getOrder()->isSent() && $order->getDeliveryModuleId() == $module->getModuleModel()->getId()) {
$contact_email = ConfigQuery::getStoreEmail();
if ($contact_email) {

View File

@@ -11,7 +11,7 @@ use Thelia\Core\Event\TheliaEvents;
/**
* Class AreaDeletedListener
* @package AreaDeletedListener\EventListener
* @author Thomas Arnaud <tarnaud@openstudio.fr>
* @author Laurent LE CORRE <laurent@thecoredev.fr>
*/
class AreaDeletedListener implements EventSubscriberInterface
{
@@ -20,13 +20,13 @@ class AreaDeletedListener implements EventSubscriberInterface
*/
public function updateConfig(AreaDeleteEvent $event)
{
if (null !== $data = DHL::getConfigValue(DHLConfigValue::PRICES, null)) {
$areaId = $event->getAreaId();
$json_data = json_decode($data, true);
unset($json_data[$areaId]);
DHL::setConfigValue(DHLConfigValue::PRICES, json_encode($json_data, true));
}
// if (null !== $data = DHL::getConfigValue(DHLConfigValue::PRICES, null)) {
// $areaId = $event->getAreaId();
// $json_data = json_decode($data, true);
// unset($json_data[$areaId]);
//
// DHL::setConfigValue(DHLConfigValue::PRICES, json_encode($json_data, true));
// }
}
/**

View File

@@ -45,7 +45,7 @@ class SendMail implements EventSubscriberInterface
->findOne();
if (false === $message) {
throw new \Exception("Failed to load message 'order_confirmation'.");
throw new \Exception("Failed to load message 'mail_dhl'.");
}
$order = $event->getOrder();