Skip to content

Commit c2ea39a

Browse files
authored
VCST-4114: Update line item name with product localized name (#90)
1 parent 46f6e81 commit c2ea39a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/VirtoCommerce.XCart.Core/CartAggregate.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,16 @@ public virtual Task<CartAggregate> UpdatePrices(LineItem lineItem, CartProduct c
948948
return Task.FromResult(this);
949949
}
950950

951+
public virtual Task<CartAggregate> UpdateProductName(LineItem lineItem, CartProduct cartProduct)
952+
{
953+
if (cartProduct?.Product != null)
954+
{
955+
lineItem.Name = cartProduct.GetName(Cart.LanguageCode);
956+
}
957+
958+
return Task.FromResult(this);
959+
}
960+
951961
public virtual async Task<CartAggregate> UpdateOrganization(ShoppingCart cart, Member member)
952962
{
953963
if (member is Contact contact && cart.Type != CartType.Wishlist && cart.Type != CartType.SavedForLater)

src/VirtoCommerce.XCart.Data/Services/CartAggregateRepository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ private async Task<CartAggregate> InnerGetCartAggregateFromCartNoCacheAsync(Shop
315315
await aggregate.UpdateVendor(lineItem, cartProduct);
316316
await aggregate.UpdateImageUrl(lineItem, cartProduct);
317317
await aggregate.UpdatePrices(lineItem, cartProduct);
318+
await aggregate.UpdateProductName(lineItem, cartProduct);
318319

319320
// validate price change
320321
var lineItemContext = new CartLineItemPriceChangedValidationContext

0 commit comments

Comments
 (0)