Skip to content

Commit 5b93a76

Browse files
author
mastiuhin-olexandr
committed
MC-35416: It is not possible to Manage Shopping Cart from Customer edit page after adding product to Wish List
1 parent 9e7b088 commit 5b93a76

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/code/Magento/Wishlist/Model/ResourceModel/Item/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ protected function _renderFiltersBefore()
398398
$availableProductTypes = $this->salesConfig->getAvailableProductTypes();
399399
$this->getSelect()->join(
400400
['cat_prod' => $this->getTable('catalog_product_entity')],
401-
$this->getConnection()->quoteInto('cat_prod.type_id IN (?)', $availableProductTypes),
401+
$this->getConnection()->quoteInto('cat_prod.type_id IN (?) AND main_table.product_id = cat_prod.entity_id', $availableProductTypes),
402402
[]
403403
);
404404
}

dev/tests/integration/testsuite/Magento/Wishlist/Model/ResourceModel/Item/CollectionTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ public function testLoadedProductAttributes()
6262
$this->assertEquals('Short description', $productOnWishlist->getData('short_description'));
6363
}
6464

65+
/**
66+
* Tests collection load.
67+
* Tests collection load method when product salable filter flag is setted to true
68+
* and few products are present.
69+
*
70+
* @magentoDataFixture Magento/Catalog/_files/second_product_simple.php
71+
* @magentoDataFixture Magento/Wishlist/_files/wishlist.php
72+
*/
73+
public function testGonnaCutYouDown()
74+
{
75+
$this->itemCollection->setSalableFilter(true);
76+
$this->itemCollection->load();
77+
}
78+
6579
/**
6680
* @param array $attributes
6781
*/

0 commit comments

Comments
 (0)