Skip to content

Commit 2bb47f8

Browse files
author
Anna Bukatar
committed
ACP2E-1181: Browser cache not updating product price on home page based on customer group tax rule.
1 parent 91549b9 commit 2bb47f8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public function getCacheKeyInfo()
223223
$this->_storeManager->getStore()->getId(),
224224
$this->_design->getDesignTheme()->getId(),
225225
$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_GROUP),
226+
$this->json->serialize($this->httpContext->getValue('tax_rates')),
226227
(int)$this->getRequest()->getParam($this->getData('page_var_name'), 1),
227228
$this->getProductsPerPage(),
228229
$this->getProductsCount(),

app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,14 @@ public function testGetCacheKeyInfo()
163163
$theme->expects($this->once())->method('getId')->willReturn('blank');
164164
$this->design->expects($this->once())->method('getDesignTheme')->willReturn($theme);
165165

166-
$this->httpContext->expects($this->once())->method('getValue')->willReturn('context_group');
166+
$this->httpContext->expects($this->exactly(2))
167+
->method('getValue')
168+
->withConsecutive(
169+
[$this->equalTo(\Magento\Customer\Model\Context::CONTEXT_GROUP)],
170+
[$this->equalTo('tax_rates')]
171+
)
172+
->willReturnOnConsecutiveCalls('context_group', [10]);
173+
167174
$this->productsList->setData('conditions', 'some_serialized_conditions');
168175

169176
$this->productsList->setData('page_var_name', 'page_number');
@@ -188,6 +195,7 @@ public function testGetCacheKeyInfo()
188195
1,
189196
'blank',
190197
'context_group',
198+
'[10]',
191199
1,
192200
5,
193201
10,

0 commit comments

Comments
 (0)