Skip to content

Commit e751432

Browse files
committed
#35881: Final Price for grouped products does not include tax in the Recently Viewed Widget and Meta price
- fix Module Magento\Catalog added validation for the isset of a related product in a grouped
1 parent 70d0a6c commit e751432

File tree

2 files changed

+37
-35
lines changed
  • app/code/Magento/Catalog

2 files changed

+37
-35
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/Collector/Price.php

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,40 +82,42 @@ public function collect(ProductInterface $product, ProductRenderInterface $produ
8282
->getMinProduct();
8383
}
8484

85-
$priceInfo->setFinalPrice(
86-
$product
87-
->getPriceInfo()
88-
->getPrice(FinalPrice::PRICE_CODE)
89-
->getAmount()
90-
->getValue()
91-
);
92-
$priceInfo->setMinimalPrice(
93-
$product
94-
->getPriceInfo()
95-
->getPrice(FinalPrice::PRICE_CODE)
96-
->getMinimalPrice()
97-
->getValue()
98-
);
99-
$priceInfo->setRegularPrice(
100-
$product
101-
->getPriceInfo()
102-
->getPrice(RegularPrice::PRICE_CODE)
103-
->getAmount()
104-
->getValue()
105-
);
106-
$priceInfo->setMaxPrice(
107-
$product
108-
->getPriceInfo()
109-
->getPrice(FinalPrice::PRICE_CODE)
110-
->getMaximalPrice()
111-
->getValue()
112-
);
85+
if ($product !== null) {
86+
$priceInfo->setFinalPrice(
87+
$product
88+
->getPriceInfo()
89+
->getPrice(FinalPrice::PRICE_CODE)
90+
->getAmount()
91+
->getValue()
92+
);
93+
$priceInfo->setMinimalPrice(
94+
$product
95+
->getPriceInfo()
96+
->getPrice(FinalPrice::PRICE_CODE)
97+
->getMinimalPrice()
98+
->getValue()
99+
);
100+
$priceInfo->setRegularPrice(
101+
$product
102+
->getPriceInfo()
103+
->getPrice(RegularPrice::PRICE_CODE)
104+
->getAmount()
105+
->getValue()
106+
);
107+
$priceInfo->setMaxPrice(
108+
$product
109+
->getPriceInfo()
110+
->getPrice(FinalPrice::PRICE_CODE)
111+
->getMaximalPrice()
112+
->getValue()
113+
);
113114

114-
$this->formattedPriceInfoBuilder->build(
115-
$priceInfo,
116-
$productRender->getStoreId(),
117-
$productRender->getCurrencyCode()
118-
);
115+
$this->formattedPriceInfoBuilder->build(
116+
$priceInfo,
117+
$productRender->getStoreId(),
118+
$productRender->getCurrencyCode()
119+
);
120+
}
119121

120122
$productRender->setPriceInfo($priceInfo);
121123
}

app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ if ($block->getProduct()->getTypeId() === Grouped::TYPE_CODE):
3333
->getPrice(FinalPrice::PRICE_CODE)
3434
->getMinProduct();
3535

36-
$priceAmount = $minProduct->getPriceInfo()
36+
$priceAmount = ($minProduct !== null) ? $minProduct->getPriceInfo()
3737
->getPrice(FinalPrice::PRICE_CODE)
38-
->getAmount();
38+
->getAmount() : $minProduct;
3939
else:
4040
$priceAmount = $block->getProduct()
4141
->getPriceInfo()

0 commit comments

Comments
 (0)