We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ed47c5d + f5d2d74 commit d2316e9Copy full SHA for d2316e9
app/code/Magento/Bundle/view/base/web/js/price-bundle.js
@@ -374,8 +374,17 @@ define([
374
function applyTierPrice(oneItemPrice, qty, optionConfig) {
375
var tiers = optionConfig.tierPrice,
376
magicKey = _.keys(oneItemPrice)[0],
377
+ tiersFirstKey = _.keys(optionConfig)[0],
378
lowest = false;
379
380
+ if (!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"
385
+ return a['price_qty'] - b['price_qty'];
386
+ });
387
388
_.each(tiers, function (tier, index) {
389
if (tier['price_qty'] > qty) {
390
return;
0 commit comments