Skip to content

Commit 6577c64

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".
1 parent 9afef99 commit 6577c64

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,11 @@ define([
377377
lowest = false;
378378

379379
//sorting based on "price_qty"
380-
tiers.sort(function(a, b) {
381-
return a.price_qty - b.price_qty;
382-
});
380+
if(tiers){
381+
tiers.sort(function (a, b) {
382+
return a.price_qty - b.price_qty;
383+
});
384+
}
383385

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

0 commit comments

Comments
 (0)