Skip to content

Commit

Permalink
Some small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Jul 30, 2023
1 parent c94b1db commit b692296
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Modules/OrchardCore.Commerce/Services/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using OrchardCore.Commerce.Extensions;
using OrchardCore.Commerce.Models;
using OrchardCore.Commerce.MoneyDataType;
using OrchardCore.Commerce.MoneyDataType.Extensions;
using OrchardCore.Commerce.Promotion.Extensions;
using OrchardCore.Commerce.Tax.Extensions;
using OrchardCore.Commerce.ViewModels;
Expand Down Expand Up @@ -170,8 +169,8 @@ public async Task FinalModificationOfOrderAsync(ContentItem order)

await userService.AlterUserSettingAsync(user, UserAddresses, contentItem =>
{
var part = contentItem.ContainsKey(nameof(UserAddressesPart))
? contentItem[nameof(UserAddressesPart)].ToObject<UserAddressesPart>()!
var part = contentItem.TryGetValue(nameof(UserAddressesPart), out var partJson)
? partJson.ToObject<UserAddressesPart>()!
: new UserAddressesPart();
part.BillingAndShippingAddressesMatch.Value = isSame;
Expand Down Expand Up @@ -207,7 +206,7 @@ public async Task<ContentItem> CreateNoPaymentOrderFromShoppingCartAsync()
order.As<OrderPart>().ShippingAddress.Address,
order.As<OrderPart>().BillingAddress.Address);

if (!cartViewModel.Totals.Any() || cartViewModel.Totals.Sum().Value != 0)
if (!cartViewModel.Totals.Any() || cartViewModel.Totals.Any(total => total.Value > 0))
{
return null;
}
Expand Down

0 comments on commit b692296

Please sign in to comment.