Skip to content

Commit a30f556

Browse files
committed
MC-41652: Reflect changed price: Product
- fix test failures
1 parent 1ddec1e commit a30f556

File tree

2 files changed

+9
-4
lines changed
  • app/code/Magento/Paypal/view/frontend/web/js/view
  • dev/tests/integration/testsuite/Magento/Paypal/Block/PayLater

2 files changed

+9
-4
lines changed

app/code/Magento/Paypal/view/frontend/web/js/view/paylater.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define([
88
'ko',
99
'uiElement',
1010
'Magento_Paypal/js/in-context/paypal-sdk',
11+
'priceBox',
1112
'domReady!'
1213
], function (
1314
$,
@@ -44,8 +45,12 @@ define([
4445

4546
if (this.displayAmount) {
4647
priceBox = $(this.priceBoxSelector);
47-
this.price = priceBox.priceBox('option').priceConfig.prices.finalPrice.amount;
48-
priceBox.on('priceUpdated', this._onPriceChange.bind(this));
48+
if (priceBox.priceBox('option') &&
49+
priceBox.priceBox('option').prices
50+
) {
51+
this.price = priceBox.priceBox('option').prices.finalPrice.amount;
52+
priceBox.on('priceUpdated', this._onPriceChange.bind(this));
53+
}
4954

5055
qty = $(this.qtyFieldSelector);
5156
qty.on('change', this._onQtyChange.bind(this));

dev/tests/integration/testsuite/Magento/Paypal/Block/PayLater/BannerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
declare(strict_types=1);
88

9-
namespace Magento\Paypal\Block\Paylater;
9+
namespace Magento\Paypal\Block\PayLater;
1010

1111
use Magento\Framework\View\LayoutInterface;
1212
use Magento\TestFramework\Helper\Bootstrap;
@@ -44,7 +44,7 @@ public function getJsLayoutDataProvider()
4444
return [
4545
[
4646
['data-pp-placement' => 'test-page'],
47-
['attributes' => ['data-pp-placement' => 'test-page']]
47+
['attributes' => ['data-pp-placement' => 'test-page', 'data-pp-style-logo-position' => 'right']]
4848
],
4949
];
5050
}

0 commit comments

Comments
 (0)