Skip to content

Commit 11959be

Browse files
return a bundle base price
1 parent 7c9d9d3 commit 11959be

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Umbraco.Commerce.Cart/Web/Api/Models/CartDto.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ public class CartDto
1010
public class BundlableCartItemDto : CartItemDto
1111
{
1212
public string? BundleReference { get; set; }
13+
14+
public FormattedPriceDto? BasePrice { get; set; }
1315
public IEnumerable<CartItemDto> Items { get; set; }
1416
}
1517

src/Umbraco.Commerce.Cart/Web/Api/Models/Factories/CartModelFactory.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ internal static async Task<CartDto> EntityToDtoAsync(MappingContext ctx, OrderRe
1919

2020
if (x.IsBundle(out var bundleOrderLineReadOnly))
2121
{
22+
var basePrice = await bundleOrderLineReadOnly.BasePrice.WithoutAdjustments.FormattedAsync();
23+
2224
ol.BundleReference = bundleOrderLineReadOnly.BundleId;
2325
ol.Items = await bundleOrderLineReadOnly.OrderLines
2426
.SelectAsync(async y => await ItemEntityToDtoAsync(ctx, y, new CartItemDto()));
27+
ol.BasePrice = new FormattedPriceDto
28+
{
29+
WithTax = basePrice.WithTax,
30+
Tax = basePrice.Tax,
31+
WithoutTax = basePrice.WithoutTax
32+
};
2533
}
2634

2735
return ol;

0 commit comments

Comments
 (0)