Skip to content

Commit d4dd2e6

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

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,16 @@ define([
376376
magicKey = _.keys(oneItemPrice)[0],
377377
lowest = false;
378378

379-
//sorting based on "price_qty"
380-
if(tiers){
381-
tiers.sort(function (a, b) {
382-
return a.price_qty - b.price_qty;
383-
});
384-
}
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) {
387+
return a['price_qty'] - b['price_qty'];
388+
});
385389

386390
_.each(tiers, function (tier, index) {
387391
if (tier['price_qty'] > qty) {

0 commit comments

Comments
 (0)