Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyawzrd committed Nov 10, 2020
1 parent 82309c7 commit 775ef88
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions VirtoCommerce.Storefront/Domain/Cart/Demo/DemoCartBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,17 @@ public override async Task MergeWithCartAsync(ShoppingCart cart)
{
var newGroup = new ConfiguredGroup(group.Quantity, group.Currency, group.ProductId);
Cart.ConfiguredGroups.Add(newGroup);

foreach (var item in group.Items)
{
var newItem = item.Clone() as LineItem;
var newItem = (LineItem)item.Clone();
newItem.ConfiguredGroupId = newGroup.Id;
var existingLineItem = cart.Items.FirstOrDefault(li => li.ProductId.EqualsInvariant(newItem.ProductId));
cart.Items.Remove(existingLineItem);
if (existingLineItem != null)
{
cart.Items.Remove(existingLineItem);
}

await AddLineItemAsync(newItem);
}
}
Expand Down

0 comments on commit 775ef88

Please sign in to comment.