From ac690bc2c7e9fca2a9f657db41523f0bc6ee36b4 Mon Sep 17 00:00:00 2001 From: Laurent LE CORRE Date: Wed, 11 Dec 2019 11:49:40 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20du=20bogue=20sur=20le=20module=20P?= =?UTF-8?q?aypal,=20qui=20ne=20r=C3=A9cup=C3=A9rait=20pas=20le=20bon=20mod?= =?UTF-8?q?ule=20de=20livraison?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Model/Module.php | 2 +- .../modules/PayPal/Controller/PayPalResponseController.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Model/Module.php b/core/lib/Thelia/Model/Module.php index b967e484..117fa00a 100644 --- a/core/lib/Thelia/Model/Module.php +++ b/core/lib/Thelia/Model/Module.php @@ -275,7 +275,7 @@ class Module extends BaseModule $instance = $this->getModuleInstance($container); if (! $instance instanceof DeliveryModuleInterface) { - throw new \InvalidArgumentException(sprintf('Module "%s" is not a payment module', $this->getCode())); + throw new \InvalidArgumentException(sprintf('Module "%s" is not a delivery module', $this->getCode())); } return $instance; diff --git a/local/modules/PayPal/Controller/PayPalResponseController.php b/local/modules/PayPal/Controller/PayPalResponseController.php index ca5589af..50a2ab9f 100644 --- a/local/modules/PayPal/Controller/PayPalResponseController.php +++ b/local/modules/PayPal/Controller/PayPalResponseController.php @@ -384,7 +384,12 @@ class PayPalResponseController extends OrderController $deliveryAddress = $cart->getCustomer()->getDefaultAddress(); /** @var \Thelia\Model\Module $deliveryModule */ - $deliveryModule = ModuleQuery::create()->filterByActivate(1)->findOne(); + /*$deliveryModule = ModuleQuery::create()->filterByActivate(1)->findOne();*/ + $order = $this->getSession()->getOrder(); + if (null !== $order) { + $deliveryModule = $order->getModuleRelatedByDeliveryModuleId(); + } + /** @var \Thelia\Model\Module $paymentModule */ $paymentModule = ModuleQuery::create()->findPk(PayPal::getModuleId());