Skip to content

Commit 97d6f3d

Browse files
committed
ACP2E-3955: [Mainline] Price of product in cart affected by catalog price rule doesn't change when rule is updated
- Initial solution
1 parent ce978e1 commit 97d6f3d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/code/Magento/CatalogRule/Plugin/Model/Indexer/RecollectQuoteAfterRuleChange.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(
2727
* Recollect quote on product ids after rule change.
2828
*
2929
* @param Price $subject
30-
* @param $result
30+
* @param void $result
3131
* @param array $ids
3232
* @return void
3333
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

dev/tests/integration/testsuite/Magento/CatalogRule/Model/RuleTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ protected function setUp(): void
8484

8585
/**
8686
* @magentoAppIsolation enabled
87-
* @covers Rule::calcProductPriceRule
8887
*/
8988
public function testCalcProductPriceRule()
9089
{
@@ -145,7 +144,6 @@ protected function _getCatalogRulesFixtures()
145144
DataFixture(
146145
AddProductToCartFixture::class,
147146
['cart_id' => '$cart.id$', 'product_id' => '$product.id$', 'qty' => 1]
148-
149147
),
150148
DataFixture(ScheduleMode::class, ['indexer' => ProductPriceIndexerProcessor::INDEXER_ID]),
151149
DataFixture(ScheduleMode::class, ['indexer' => RuleProductProcessor::INDEXER_ID])
@@ -177,9 +175,8 @@ public function testChangeInCatalogPriceRuleUpdatesTheQuote()
177175
$updatedCartRepo = $this->objectManager->create(CartRepositoryInterface::class);
178176
$updatedCartDetails = $updatedCartRepo->get($cart->getId());
179177

180-
$updatedCartDetails->collectTotals()->save();
181178
$updatedItems = $updatedCartDetails->getAllItems();
182-
//verify that the cart item price is updated after the catalog rule change
179+
183180
$this->assertCount(1, $updatedItems);
184181
$this->assertEquals($updatedItems[0]->getProduct()->getId(), $product->getId());
185182
$this->assertEquals((float) $updatedItems[0]->getPrice(), 50.00);

0 commit comments

Comments
 (0)