Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 2ab14c2

Browse files
committed
MAGETWO-72875: Incorrect catalog rule price for bundle product with custom option
1 parent 5f670aa commit 2ab14c2

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app/code/Magento/Catalog/Pricing/Price/CustomOptionPriceCalculator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ public function getOptionPriceByPriceCode(
3737
if ($optionValue->getPriceType() === ProductOptionValue::TYPE_PERCENT) {
3838
$basePrice = $optionValue->getOption()->getProduct()->getPriceInfo()->getPrice($priceCode)->getValue();
3939
$price = $basePrice * ($optionValue->getData(ProductOptionValue::KEY_PRICE) / 100);
40+
4041
return $price;
4142
}
43+
4244
return $optionValue->getData(ProductOptionValue::KEY_PRICE);
4345
}
4446
}

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,12 +1414,12 @@ public function testGetFinalPricePreset()
14141414
$productTypePriceMock->expects($this->any())
14151415
->method('getFinalPrice')
14161416
->with($qty, $this->model)
1417-
->will($this->returnValue($finalPrice));
1417+
->willReturn($finalPrice);
14181418

14191419
$this->productTypeInstanceMock->expects($this->any())
14201420
->method('priceFactory')
14211421
->with($this->model->getTypeId())
1422-
->will($this->returnValue($productTypePriceMock));
1422+
->willReturn($productTypePriceMock);
14231423

14241424
$this->assertEquals($finalPrice, $this->model->getFinalPrice($qty));
14251425
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Price.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ class Price extends \Magento\Catalog\Test\Block\AbstractPriceBlock
3636
'selector' => '.price-to .price',
3737
],
3838
'price_excluding_tax' => [
39-
'selector' => '.price-excluding-tax .price'
39+
'selector' => '.price-excluding-tax .price',
4040
],
4141
'price_including_tax' => [
42-
'selector' => '.price-including-tax .price'
42+
'selector' => '.price-including-tax .price',
4343
],
4444
'old_price_from' => [
45-
'selector' => '.price-from .old-price .price-wrapper'
45+
'selector' => '.price-from .old-price .price-wrapper',
4646
],
4747
'old_price_to' => [
48-
'selector' => '.price-to .old-price .price-wrapper'
48+
'selector' => '.price-to .old-price .price-wrapper',
4949
],
5050
];
5151

0 commit comments

Comments
 (0)