Skip to content

Commit 9afef99

Browse files
adarshkhatriamol2jcommerce
authored andcommitted
Update price-bundle.js
By default tier price is sorted by "price_id". With this tier price calculation while displaying in bundle product is wrong. Need to sort tier price by "price_qty". Issue created: #21467
1 parent 4dd101e commit 9afef99

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ define([
375375
var tiers = optionConfig.tierPrice,
376376
magicKey = _.keys(oneItemPrice)[0],
377377
lowest = false;
378+
379+
//sorting based on "price_qty"
380+
tiers.sort(function(a, b) {
381+
return a.price_qty - b.price_qty;
382+
});
378383

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

0 commit comments

Comments
 (0)