From 7d733b4ec0a97baf638612d26c639f35d20b537f Mon Sep 17 00:00:00 2001 From: Vitalij Mik Date: Wed, 28 Feb 2024 15:55:18 +0100 Subject: [PATCH] NTR: fix translation problem --- src/Controller/Api/PluginConfig/ConfigControllerBase.php | 4 ++-- src/Service/PaymentMethodService.php | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Controller/Api/PluginConfig/ConfigControllerBase.php b/src/Controller/Api/PluginConfig/ConfigControllerBase.php index 8df0fb221..a3b65a153 100644 --- a/src/Controller/Api/PluginConfig/ConfigControllerBase.php +++ b/src/Controller/Api/PluginConfig/ConfigControllerBase.php @@ -207,10 +207,10 @@ public function getRefundManagerConfigLegacy(Request $request, Context $context) } /** - * @Route("/api/_action/mollie/config/subscription", name="api.action.mollie.config.subscription-enabled", methods={"POST"}) + * @Route("/api/_action/mollie/config/subscription", name="api.action.mollie.config.subscription", methods={"POST"}) * @return JsonResponse */ - public function isSubscriptionEnabled():JsonResponse + public function getSubscriptionConfig(): JsonResponse { $config = $this->settings->getSettings(); return new JsonResponse([ diff --git a/src/Service/PaymentMethodService.php b/src/Service/PaymentMethodService.php index 5d9c1e85d..84a78ae16 100644 --- a/src/Service/PaymentMethodService.php +++ b/src/Service/PaymentMethodService.php @@ -37,6 +37,7 @@ use Shopware\Core\Checkout\Payment\PaymentMethodEntity; use Shopware\Core\Content\Media\MediaCollection; use Shopware\Core\Content\Media\MediaService; +use Shopware\Core\Defaults; use Shopware\Core\Framework\Context; use Shopware\Core\Framework\DataAbstractionLayer\Event\EntityWrittenContainerEvent; use Shopware\Core\Framework\DataAbstractionLayer\Exception\InconsistentCriteriaIdsException; @@ -176,6 +177,7 @@ public function addPaymentMethods(array $paymentMethods, Context $context): void # so we need to provide those with the value of # the existing method!!! 'name' => $existingPaymentMethod->getName(), + 'translated'=>$existingPaymentMethod->getTranslated() ]; if ($this->versionCompare->gte('6.5.7.0')) { @@ -193,6 +195,11 @@ public function addPaymentMethods(array $paymentMethods, Context $context): void 'description' => '', 'mediaId' => $mediaId, 'afterOrderEnabled' => true, + 'translated'=>[ + Defaults::LANGUAGE_SYSTEM=>[ + 'name' => $paymentMethod['description'] + ] + ] ]; }