Skip to content

Commit 1d54fa3

Browse files
author
Joan He
committed
Merge remote-tracking branch 'honey/MC-15060' into pr
2 parents dc339eb + 0c163f9 commit 1d54fa3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontMiniCartActionGroup.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,11 @@
3535
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
3636
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
3737
</actionGroup>
38+
39+
<!--Check that the minicart is empty-->
40+
<actionGroup name="assertMiniCartEmpty">
41+
<dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/>
42+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/>
43+
<see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/>
44+
</actionGroup>
3845
</actionGroups>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ protected function _assignProducts(): self
256256
foreach ($this as $item) {
257257
/** @var ProductInterface $product */
258258
$product = $productCollection->getItemById($item->getProductId());
259-
$isValidProduct = $this->isValidProduct($product);
260259
$qtyOptions = [];
261-
if ($isValidProduct) {
260+
if ($product && $this->isValidProduct($product)) {
262261
$product->setCustomOptions([]);
263262
$optionProductIds = $this->getOptionProductIds($item, $product, $productCollection);
264263
foreach ($optionProductIds as $optionProductId) {

0 commit comments

Comments
 (0)