Skip to content

Commit

Permalink
Update price-bundle.js
Browse files Browse the repository at this point in the history
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: magento#21467
  • Loading branch information
adarshkhatri authored and amol2jcommerce committed Mar 20, 2019
1 parent 4dd101e commit 9afef99
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/code/Magento/Bundle/view/base/web/js/price-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ define([
var tiers = optionConfig.tierPrice,
magicKey = _.keys(oneItemPrice)[0],
lowest = false;

//sorting based on "price_qty"
tiers.sort(function(a, b) {
return a.price_qty - b.price_qty;
});

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

0 comments on commit 9afef99

Please sign in to comment.