Skip to content

Commit 1586e8d

Browse files
committed
MC-35618: Unexpected results of editing a Grouped Product in the Wish List by a Customer
1 parent 47ad3ae commit 1586e8d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

app/code/Magento/GroupedProduct/Model/Wishlist/Product/Item.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public function beforeCompareOptions(
8383

8484
if (!$diff) {
8585
foreach (array_keys($options1) as $key) {
86-
if (
87-
preg_match('/associated_product_\d+/', $key)
86+
if (preg_match('/associated_product_\d+/', $key)
8887
&& $this->isAddAction($productOptions['info_buyRequest'])
8988
) {
9089
unset($options1[$key]);

app/code/Magento/Wishlist/Model/Wishlist.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,9 @@ public function updateItem($itemId, $buyRequest, $params = null)
756756
$isForceSetQuantity = true;
757757
foreach ($items as $_item) {
758758
/* @var $_item Item */
759-
if ($_item->getProductId() == $product->getId() && $_item->representProduct(
760-
$product
761-
) && $_item->getId() != $item->getId()
759+
if ($_item->getProductId() == $product->getId()
760+
&& $_item->getId() != $item->getId()
761+
&& $_item->representProduct($product)
762762
) {
763763
// We do not add new wishlist item, but updating the existing one
764764
$isForceSetQuantity = false;

app/code/Magento/Wishlist/Test/Unit/Controller/Index/UpdateItemOptionsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public function testExecuteAddSuccessException()
380380
$wishlist
381381
->expects($this->once())
382382
->method('updateItem')
383-
->with(3, new DataObject([]))
383+
->with(3, new DataObject(['action' => 'updateItem']))
384384
->willReturnSelf();
385385
$wishlist
386386
->expects($this->once())
@@ -509,7 +509,7 @@ public function testExecuteAddSuccessCriticalException()
509509
$wishlist
510510
->expects($this->once())
511511
->method('updateItem')
512-
->with(3, new DataObject([]))
512+
->with(3, new DataObject(['action' => 'updateItem']))
513513
->willReturnSelf();
514514
$wishlist
515515
->expects($this->once())

0 commit comments

Comments
 (0)