diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 373b88049c7b5..0c9b47f6fa6d7 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -160,7 +160,7 @@ public function getCacheKeyInfo() return [ 'CATALOG_PRODUCTS_LIST_WIDGET', - $this->getPriceCurrency()->getCurrencySymbol(), + $this->getPriceCurrency()->getCurrency()->getCode(), $this->_storeManager->getStore()->getId(), $this->_design->getDesignTheme()->getId(), $this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_GROUP), diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index e871ed4359d5c..2ac222bf82679 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -147,7 +147,9 @@ public function testGetCacheKeyInfo() $this->request->expects($this->once())->method('getParam')->with('page_number')->willReturn(1); $this->request->expects($this->once())->method('getParams')->willReturn('request_params'); - $this->priceCurrency->expects($this->once())->method('getCurrencySymbol')->willReturn('$'); + $currency = $this->createMock(\Magento\Directory\Model\Currency::class); + $currency->expects($this->once())->method('getCode')->willReturn('USD'); + $this->priceCurrency->expects($this->once())->method('getCurrency')->willReturn($currency); $this->serializer->expects($this->any()) ->method('serialize') @@ -157,7 +159,7 @@ public function testGetCacheKeyInfo() $cacheKey = [ 'CATALOG_PRODUCTS_LIST_WIDGET', - '$', + 'USD', 1, 'blank', 'context_group',