Skip to content

Commit

Permalink
VCST-1820: fix for tier prices discount fix (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksavosteev authored Sep 26, 2024
1 parent 0a0e320 commit 0a6a776
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/VirtoCommerce.XCatalog.Core/Models/ExpProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ public virtual void ApplyRewards(CatalogItemAmountReward[] allRewards)

foreach (var reward in mappedRewards)
{
foreach (var tierPrice in productPrice.TierPrices)
{
tierPrice.DiscountAmount = new Money(Math.Max(0, (productPrice.ListPrice - tierPrice.Price).Amount), productPrice.Currency);
}

if (!reward.IsValid)
{
continue;
Expand All @@ -161,7 +156,7 @@ public virtual void ApplyRewards(CatalogItemAmountReward[] allRewards)

foreach (var tierPrice in productPrice.TierPrices)
{
tierPrice.DiscountAmount += reward.GetRewardAmount(tierPrice.Price.Amount, 1);
tierPrice.DiscountAmount += reward.GetRewardAmount(tierPrice.ActualPrice.Amount, 1);
}
}
}
Expand Down

0 comments on commit 0a6a776

Please sign in to comment.