Skip to content

Commit

Permalink
Set original_price if not exists when adding coupon (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
MKet authored Jun 3, 2024
1 parent ce6b49e commit c72b081
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3018,6 +3018,12 @@ private async Task<HandleCouponResultModel> HandleCouponAsync(WiserItemModel sho
{
continue;
}

var originalPrice = line.GetDetailValue(Constants.OriginalPricePropertyName);
if (String.IsNullOrEmpty(originalPrice))
{
line.SetDetail(Constants.OriginalPricePropertyName, line.GetDetailValue<decimal>(settings.PricePropertyName));
}

totalPrice += await GetLinePriceAsync(shoppingBasket, line, settings, useOriginalPrice: divideDiscountOverProducts);
}
Expand All @@ -3032,6 +3038,12 @@ private async Task<HandleCouponResultModel> HandleCouponAsync(WiserItemModel sho
continue;
}

var originalPrice = line.GetDetailValue(Constants.OriginalPricePropertyName);
if (String.IsNullOrEmpty(originalPrice))
{
line.SetDetail(Constants.OriginalPricePropertyName, line.GetDetailValue<decimal>(settings.PricePropertyName));
}

totalPrice += await GetLinePriceAsync(shoppingBasket, line, settings);
}
}
Expand Down

0 comments on commit c72b081

Please sign in to comment.