Skip to content

Commit 1a10810

Browse files
MAGETWO-96308: Configurable "As low As" Product Price Not Updating Correctly
1 parent dc900b9 commit 1a10810

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ define([
499499
optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount);
500500
optionPriceDiff = optionFinalPrice - basePrice;
501501
}
502+
502503
if (optionPriceDiff !== 0) {
503504
prices = {};
504505
priceValue = this._calculatePriceDifference(allowedProduct);
@@ -530,6 +531,7 @@ define([
530531
optionMinPrice = optionFinalPrice;
531532
product = allowedProduct;
532533
}
534+
533535
if (optionFinalPrice < optionMinPrice) {
534536
product = allowedProduct;
535537
}
@@ -550,6 +552,7 @@ define([
550552
newPrices = this.options.spConfig.optionPrices[allowedProduct];
551553

552554
_.each(displayPrices, function (price, code) {
555+
553556
if (newPrices[code]) {
554557
displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount;
555558
}

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,10 +976,12 @@ define([
976976
allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts());
977977
optionPrices = this.options.jsonConfig.optionPrices;
978978
basePrice = parseFloat(this.options.jsonConfig.prices.basePrice.amount);
979+
979980
if (!_.isEmpty(allowedProduct)) {
980981
optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount);
981982
optionPriceDiff = optionFinalPrice - basePrice;
982983
}
984+
983985
if (optionPriceDiff !== 0) {
984986
newPrices = this.options.jsonConfig.optionPrices[allowedProduct];
985987
} else {
@@ -988,6 +990,7 @@ define([
988990
}
989991

990992
_.each(displayPrices, function (price, code) {
993+
991994
if (newPrices[code]) {
992995
displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount;
993996
}
@@ -1015,6 +1018,7 @@ define([
10151018
optionMinPrice = optionFinalPrice;
10161019
product = allowedProduct;
10171020
}
1021+
10181022
if (optionFinalPrice < optionMinPrice) {
10191023
product = allowedProduct;
10201024
}

0 commit comments

Comments
 (0)