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: #21467
  • Loading branch information
adarshkhatri authored Feb 27, 2019
1 parent 169b3eb commit caabef2
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 caabef2

Please sign in to comment.