Added coupon processing. Fixed price calculation

This commit is contained in:
Marcel Baumgartner
2023-10-22 22:02:45 +02:00
parent 3d4f22f6f6
commit 2dd1d1f69c
2 changed files with 48 additions and 21 deletions

View File

@@ -75,7 +75,7 @@ TODO: Add 404 here
if (SelectedCoupon == null)
actualPrice = defaultPrice;
else
actualPrice = Math.Round(defaultPrice * SelectedCoupon.Percent / 100, 2);
actualPrice = Math.Round(defaultPrice - (defaultPrice * SelectedCoupon.Percent / 100), 2);
var currency = ConfigService.Get().Store.Currency;
}
@@ -236,7 +236,7 @@ TODO: Add 404 here
if (SelectedProduct == null) // Prevent processing null
return;
// Process the order with the selected values
// Process the order with the selected values
var service = await StoreService
.Order
.Process(