Skip to content

Commit c17fe47

Browse files
committed
ACP2E-2950: [Cloud] Bundle Product wrong pricing in order confirmation
1 parent f2c48f9 commit c17fe47

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

app/code/Magento/Bundle/Model/Quote/Item/Option.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Bundle\Model\Product\Price;
1111
use Magento\Bundle\Model\Product\Type;
1212
use Magento\Catalog\Model\Product;
13+
use Magento\Framework\App\ObjectManager;
1314
use Magento\Framework\Pricing\PriceCurrencyInterface;
1415
use Magento\Framework\Serialize\Serializer\Json;
1516

@@ -34,10 +35,10 @@ class Option
3435
*/
3536
public function __construct(
3637
Json $serializer,
37-
PriceCurrencyInterface $priceCurrency,
38+
?PriceCurrencyInterface $priceCurrency = null,
3839
) {
3940
$this->serializer = $serializer;
40-
$this->priceCurrency = $priceCurrency;
41+
$this->priceCurrency = $priceCurrency ?? ObjectManager::getInstance()->get(PriceCurrencyInterface::class);
4142
}
4243

4344
/**

app/code/Magento/Bundle/Test/Unit/Model/Quote/Item/OptionTest.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,10 @@ class OptionTest extends TestCase
3535
protected function setUp(): void
3636
{
3737
parent::setUp();
38-
$priceCurrency = $this->getMockBuilder(PriceCurrencyInterface::class)
39-
->disableOriginalConstructor()
40-
->onlyMethods(
41-
['convert','convertAndRound', 'format','convertAndFormat','getCurrencySymbol','getCurrency', 'round']
42-
)
43-
->getMock();
38+
$priceCurrency = $this->createMock(PriceCurrencyInterface::class);
39+
4440
$priceCurrency->method('convert')
45-
->willReturnCallback(
46-
function ($price, $scope) {
47-
return $price;
48-
}
49-
);
41+
->willReturnArgument(0);
5042

5143
$this->model = new Option(
5244
new Json(),

0 commit comments

Comments
 (0)