From 85f40ad20b296140558f8138eeb428a608c8e177 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 15 Feb 2021 08:36:40 +0100 Subject: [PATCH 1/3] [Core] remove country-aware currency context as it messes with the Storage Based Currency Context --- .../Resources/config/services/context.yml | 6 --- .../Currency/CountryAwareCurrencyContext.php | 49 ------------------- 2 files changed, 55 deletions(-) delete mode 100644 src/CoreShop/Component/Core/Context/Currency/CountryAwareCurrencyContext.php diff --git a/src/CoreShop/Bundle/CoreBundle/Resources/config/services/context.yml b/src/CoreShop/Bundle/CoreBundle/Resources/config/services/context.yml index 25aaf57994..167184ec7b 100644 --- a/src/CoreShop/Bundle/CoreBundle/Resources/config/services/context.yml +++ b/src/CoreShop/Bundle/CoreBundle/Resources/config/services/context.yml @@ -54,9 +54,3 @@ services: - '@CoreShop\Component\Core\Context\Country\StoreAwareCountryContext.inner' - '@coreshop.context.store' - coreshop.context.currency.country_currency_based: '@CoreShop\Component\Core\Context\Currency\CountryAwareCurrencyContext' - CoreShop\Component\Core\Context\Currency\CountryAwareCurrencyContext: - arguments: - - '@coreshop.context.country' - tags: - - { name: 'coreshop.context.currency' } diff --git a/src/CoreShop/Component/Core/Context/Currency/CountryAwareCurrencyContext.php b/src/CoreShop/Component/Core/Context/Currency/CountryAwareCurrencyContext.php deleted file mode 100644 index 74de0bf9dc..0000000000 --- a/src/CoreShop/Component/Core/Context/Currency/CountryAwareCurrencyContext.php +++ /dev/null @@ -1,49 +0,0 @@ -countryContext = $countryContext; - } - - /** - * {@inheritdoc} - */ - public function getCurrency() - { - /** @var CountryInterface $country */ - $country = $this->countryContext->getCountry(); - - if (null === $country) { - throw new CurrencyNotFoundException(); - } - - return $country->getCurrency(); - } -} From 6179573a20204fda70ac3381684366c956744f2d Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Tue, 23 Feb 2021 08:36:01 +0100 Subject: [PATCH 2/3] [Registry] fix test --- src/CoreShop/Component/Registry/PriorityMap.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/CoreShop/Component/Registry/PriorityMap.php b/src/CoreShop/Component/Registry/PriorityMap.php index 1462ca882d..4e0974e5af 100644 --- a/src/CoreShop/Component/Registry/PriorityMap.php +++ b/src/CoreShop/Component/Registry/PriorityMap.php @@ -38,8 +38,6 @@ private function getScalarKey($key) * @param string $key name * @param string $value value * @param int $priority priority - * - * @return PriorityMap */ public function set($key, $value, $priority = 0) { From c51f5e16ebc75ab44a180628f692ff689377672f Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 12 Apr 2021 08:31:52 +0200 Subject: [PATCH 3/3] [Core] remove country-aware currency context as it messes with the Storage Based Currency Context - also remove tests --- features/currency/context.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/features/currency/context.feature b/features/currency/context.feature index b81d204d01..8b6c97c754 100644 --- a/features/currency/context.feature +++ b/features/currency/context.feature @@ -17,12 +17,12 @@ Feature: Adding a new Currency Scenario: Site should be using currency "USD" And I am using currency "USD" Then the site should be using currency "USD" - - Scenario: Customer comes from Country "USA" and should use currency "USD" - And I am in country "USA" - Then the site should be using currency "USD" - - Scenario: Customer comes from Country "USA" and should use currency "EUR" - Given the country "USA" is invalid for store "Austria" - And I am in country "USA" - Then the site should be using currency "EUR" \ No newline at end of file +# +# Scenario: Customer comes from Country "USA" and should use currency "USD" +# And I am in country "USA" +# Then the site should be using currency "USD"CountryAwareCurrencyContext +# +# Scenario: Customer comes from Country "USA" and should use currency "EUR" +# Given the country "USA" is invalid for store "Austria" +# And I am in country "USA" +# Then the site should be using currency "EUR"