Correction d'un bogue dans l'envoi de mail ColissimoWs + finalisation module DHL
This commit is contained in:
@@ -361,8 +361,7 @@ class Order extends BaseOrder
|
|||||||
{
|
{
|
||||||
if (is_array($statusCode)) {
|
if (is_array($statusCode)) {
|
||||||
return in_array($this->getOrderStatus()->getCode(), $statusCode);
|
return in_array($this->getOrderStatus()->getCode(), $statusCode);
|
||||||
} else {
|
} else {return $this->getOrderStatus()->getCode() == $statusCode;
|
||||||
return $this->getOrderStatus()->getCode() == $statusCode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,10 @@ class ShippingNotificationSender extends BaseAction implements EventSubscriberIn
|
|||||||
*/
|
*/
|
||||||
public function sendShippingNotification(OrderEvent $event)
|
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();
|
$contact_email = ConfigQuery::getStoreEmail();
|
||||||
|
|
||||||
if ($contact_email) {
|
if ($contact_email) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use Thelia\Core\Event\TheliaEvents;
|
|||||||
/**
|
/**
|
||||||
* Class AreaDeletedListener
|
* Class AreaDeletedListener
|
||||||
* @package AreaDeletedListener\EventListener
|
* @package AreaDeletedListener\EventListener
|
||||||
* @author Thomas Arnaud <tarnaud@openstudio.fr>
|
* @author Laurent LE CORRE <laurent@thecoredev.fr>
|
||||||
*/
|
*/
|
||||||
class AreaDeletedListener implements EventSubscriberInterface
|
class AreaDeletedListener implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
@@ -20,13 +20,13 @@ class AreaDeletedListener implements EventSubscriberInterface
|
|||||||
*/
|
*/
|
||||||
public function updateConfig(AreaDeleteEvent $event)
|
public function updateConfig(AreaDeleteEvent $event)
|
||||||
{
|
{
|
||||||
if (null !== $data = DHL::getConfigValue(DHLConfigValue::PRICES, null)) {
|
// if (null !== $data = DHL::getConfigValue(DHLConfigValue::PRICES, null)) {
|
||||||
$areaId = $event->getAreaId();
|
// $areaId = $event->getAreaId();
|
||||||
$json_data = json_decode($data, true);
|
// $json_data = json_decode($data, true);
|
||||||
unset($json_data[$areaId]);
|
// unset($json_data[$areaId]);
|
||||||
|
//
|
||||||
DHL::setConfigValue(DHLConfigValue::PRICES, json_encode($json_data, true));
|
// DHL::setConfigValue(DHLConfigValue::PRICES, json_encode($json_data, true));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class SendMail implements EventSubscriberInterface
|
|||||||
->findOne();
|
->findOne();
|
||||||
|
|
||||||
if (false === $message) {
|
if (false === $message) {
|
||||||
throw new \Exception("Failed to load message 'order_confirmation'.");
|
throw new \Exception("Failed to load message 'mail_dhl'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = $event->getOrder();
|
$order = $event->getOrder();
|
||||||
|
|||||||
Reference in New Issue
Block a user