5
5
*/
6
6
namespace Magento \Catalog \Block \Product \Widget ;
7
7
8
+ use Magento \Framework \App \Http \Context as HttpContext ;
9
+
8
10
/**
9
11
* New products widget
10
12
*/
@@ -13,29 +15,29 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct implements \Ma
13
15
/**
14
16
* Display products type - all products
15
17
*/
16
- const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products ' ;
18
+ public const DISPLAY_TYPE_ALL_PRODUCTS = 'all_products ' ;
17
19
18
20
/**
19
21
* Display products type - new products
20
22
*/
21
- const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products ' ;
23
+ public const DISPLAY_TYPE_NEW_PRODUCTS = 'new_products ' ;
22
24
23
25
/**
24
26
* Default value whether show pager or not
25
27
*/
26
- const DEFAULT_SHOW_PAGER = false ;
28
+ public const DEFAULT_SHOW_PAGER = false ;
27
29
28
30
/**
29
31
* Default value for products per page
30
32
*/
31
- const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
33
+ public const DEFAULT_PRODUCTS_PER_PAGE = 5 ;
32
34
33
35
/**
34
36
* Name of request parameter for page number value
35
37
*
36
38
* @deprecated
37
39
*/
38
- const PAGE_VAR_NAME = 'np ' ;
40
+ public const PAGE_VAR_NAME = 'np ' ;
39
41
40
42
/**
41
43
* Instance of pager block
@@ -134,13 +136,15 @@ public function getCurrentPage()
134
136
*/
135
137
public function getCacheKeyInfo ()
136
138
{
139
+ $ store = $ this ->_storeManager ->getStore ();
137
140
return array_merge (
138
141
parent ::getCacheKeyInfo (),
139
142
[
140
143
$ this ->getDisplayType (),
141
144
$ this ->getProductsPerPage (),
142
145
(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 ()
144
148
]
145
149
);
146
150
}
@@ -268,7 +272,7 @@ public function getProductPriceHtml(
268
272
? $ arguments ['display_minimal_price ' ]
269
273
: true ;
270
274
271
- /** @var \Magento\Framework\Pricing\Render $priceRender */
275
+ /** @var \Magento\Framework\Pricing\Render $priceRender */
272
276
$ priceRender = $ this ->getLayout ()->getBlock ('product.price.render.default ' );
273
277
274
278
$ price = '' ;
0 commit comments