55 */
66namespace Magento \Catalog \Block \Product \Widget ;
77
8+ use Magento \Framework \App \Http \Context as HttpContext ;
9+
810/**
911 * New products widget
1012 */
@@ -13,29 +15,29 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Ma
1315 /**
1416 * Display products type - all products
1517 */
16- const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products ' ;
18+ public const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products ' ;
1719
1820 /**
1921 * Display products type - new products
2022 */
21- const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products ' ;
23+ public const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products ' ;
2224
2325 /**
2426 * Default value whether show pager or not
2527 */
26- const DEFAULT_SHOW_PAGER = false ;
28+ public const DEFAULT_SHOW_PAGER = false ;
2729
2830 /**
2931 * Default value for products per page
3032 */
31- const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
33+ public const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
3234
3335 /**
3436 * Name of request parameter for page number value
3537 *
3638 * @deprecated
3739 */
38- const PAGE_VAR_NAME = 'np ' ;
40+ public const PAGE_VAR_NAME = 'np ' ;
3941
4042 /**
4143 * Instance of pager block
@@ -134,13 +136,15 @@ public function getCurrentPage()
134136 */
135137 public function getCacheKeyInfo ()
136138 {
139+ $ store = $ this ->_storeManager ->getStore ();
137140 return array_merge (
138141 parent ::getCacheKeyInfo (),
139142 [
140143 $ this ->getDisplayType (),
141144 $ this ->getProductsPerPage (),
142145 (int ) $ this ->getRequest ()->getParam ($ this ->getData ('page_var_name ' ), 1 ),
143- $ this ->serializer ->serialize ($ this ->getRequest ()->getParams ())
146+ $ this ->serializer ->serialize ($ this ->getRequest ()->getParams ()),
147+ $ this ->httpContext ->getValue (HttpContext::CONTEXT_CURRENCY ) ?: $ store ->getDefaultCurrency ()->getCode ()
144148 ]
145149 );
146150 }
@@ -268,7 +272,7 @@ public function getProductPriceHtml(
268272 ? $ arguments ['display_minimal_price ' ]
269273 : true ;
270274
271- /** @var \Magento\Framework\Pricing\Render $priceRender */
275+ /** @var \Magento\Framework\Pricing\Render $priceRender */
272276 $ priceRender = $ this ->getLayout ()->getBlock ('product.price.render.default ' );
273277
274278 $ price = '' ;
0 commit comments