Skip to content

Commit e7589ad

Browse files
authored
Update price-bundle.js
1 parent d4dd2e6 commit e7589ad

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,16 +374,14 @@ define([
374374
function applyTierPrice(oneItemPrice, qty, optionConfig) {
375375
var tiers = optionConfig.tierPrice,
376376
magicKey = _.keys(oneItemPrice)[0],
377+
tiersFirstKey = _.keys(optionConfig)[0],
377378
lowest = false;
378-
379-
//tiers is undefined when options has only one option
380-
if (undefined == tiers) {
381-
var firstKey = Object.keys(optionConfig)[0];
382-
tiers = optionConfig[firstKey].tierPrice;
383-
}
384-
385-
//sorting based on "price_qty"
386-
tiers.sort( function (a, b) {
379+
380+
if (undefined === tiers) {//tiers is undefined when options has only one option
381+
tiers = optionConfig[tiersFirstKey].tierPrice;
382+
}
383+
384+
tiers.sort( function (a, b) {//sorting based on "price_qty"
387385
return a['price_qty'] - b['price_qty'];
388386
});
389387

0 commit comments

Comments
 (0)