Skip to content
Discussion options

You must be logged in to vote

You can look up the content item using IProductService by passing the OrderLineItem.ContentItemVersion property to get the exact version used at the time of purchase (product content types should always be Versionable, so this will return the version used at the time of purchase, even if the content item has changed since then). For example in OrderPart.cshtml you can do this:

@inject IProductService ProductService

@foreach (var lineItem in Model.OrderPart.LineItems)
{
    var item = (await ProductService.GetProductsByContentItemVersionsAsync([lineItem.ContentItemVersion]))
        .SingleOrDefault();
    var name = item?.ContentItem.DisplayText;
    var image = item?.ProductImage.Paths?.F…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@effapp
Comment options

@sarahelsaig
Comment options

Answer selected by effapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants