Skip to content

Commit 7955395

Browse files
committed
MC-42209: Pay Later message amount change does not work on Grouped Product page
- fix static tests
1 parent 076013c commit 7955395

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/product-grouped.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ define([
9696
payLater = registry.get(this.parentName);
9797

9898
for (productId in this.priceInfo) {
99-
amount += this.priceInfo[productId].price * this.priceInfo[productId].qty;
99+
if (this.priceInfo.hasOwnProperty(productId)) {
100+
amount += this.priceInfo[productId].price * this.priceInfo[productId].qty;
101+
}
100102
}
101103

102104
payLater.amount(amount);

app/code/Magento/Paypal/view/frontend/web/js/view/amountProviders/product.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ define([
4545
(priceBox.priceBox('option').prices.finalPrice || priceBox.priceBox('option').prices.basePrice)
4646
) {
4747
this.priceType = priceBox.priceBox('option').prices.finalPrice ? 'finalPrice' : 'basePrice';
48-
this.price = priceBox.priceBox('option').prices[this.priceType]['amount'];
48+
this.price = priceBox.priceBox('option').prices[this.priceType].amount;
4949
}
5050

5151
$(this.qtyFieldSelector).on('change', this._onQtyChange.bind(this));
@@ -76,7 +76,7 @@ define([
7676
* @private
7777
*/
7878
_onPriceChange: function (event, data) {
79-
this.price = data[this.priceType]['amount'];
79+
this.price = data[this.priceType].amount;
8080
this._updateAmount();
8181
},
8282

0 commit comments

Comments
 (0)