Skip to content

Commit 8974e16

Browse files
committed
#28431 issue fixed
1 parent ba8fae3 commit 8974e16

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/code/Magento/Bundle/Model/Product/LinksList.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product, $o
5050
$productLinks = [];
5151
/** @var \Magento\Catalog\Model\Product $selection */
5252
foreach ($selectionCollection as $selection) {
53+
$bundledProductPrice = $selection->getSelectionPriceValue();
54+
if ($bundledProductPrice <= 0){
55+
$bundledProductPrice = $selection->getPrice();
56+
}
5357
$selectionPriceType = $product->getPriceType() ? $selection->getSelectionPriceType() : null;
54-
$selectionPrice = $product->getPriceType() ? $selection->getSelectionPriceValue() : null;
58+
$selectionPrice = $bundledProductPrice ? $bundledProductPrice : null;
5559

5660
/** @var \Magento\Bundle\Api\Data\LinkInterface $productLink */
5761
$productLink = $this->linkFactory->create();

app/code/Magento/Bundle/Test/Unit/Model/Product/LinksListTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testLinksList()
7777
->method('getSelectionsCollection')
7878
->with([$optionId], $this->productMock)
7979
->willReturn([$this->selectionMock]);
80-
$this->productMock->expects($this->exactly(2))->method('getPriceType')->willReturn('price_type');
80+
$this->productMock->expects($this->once())->method('getPriceType')->willReturn('price_type');
8181
$this->selectionMock->expects($this->once())
8282
->method('getSelectionPriceType')
8383
->willReturn('selection_price_type');

0 commit comments

Comments
 (0)