Developer forum

Forum » Feature requests » CartOrderlineViewModel missing ID

CartOrderlineViewModel missing ID

Roald Haahr Jensen


Using a CartViewModel in 9.7.2, I notice that the ID of an order line is missing fra the CartOrderlineViewModel making it impossible to add decrease/increase quantity to the order lines.
Also, CartOrderlineViewModel.ProductLink returns a link to the list rather than the product details page. Can this be fixed?

Following is a list of values returned by a CartOrderlineViewModel that is not a variant and has no image:

        ProductID: RFM52206268
        ProductName: meadow  orange
        ProductNumber: RFM52206268
        Quantity: 11
        TotalDiscount: Dynamicweb.Frontend.PriceViewModel
        TotaltPrice: Dynamicweb.Frontend.PriceViewModel
        UnitPrice: Dynamicweb.Frontend.PriceViewModel
        IsDiscount: False
        IsProduct: True
        IsTax: False

Can this be fixed?


Best regards,
Roald, Novicell


Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen

The link will be the page from which you added the product from. So you probably have a add to cart on your product list. So you have to build the link to the product page your self...

The orderlineviewmodel does not have the property fro the orderlineid. We have to add that in order to support that. Alternatively you can get hold of Ecommerce.Common.Context.Cart in your template - it will give you full access to all you need.

BR Nicolai

Roald Haahr Jensen

Hi Nicolai,

Without the OrderLineId available on the view model, I don't see how I can build a link back to the product, even with a link to the product page.

For now, I will use Ecommerce.Common.Context.Cart as you suggested. However, I would still like you to add OrderLineId to use in later templates and projects.
I really appreciate that we can use view models, but it seems to me that some of them still need a bit of work like in this case. It is a pity that I have to use Ecommerce.Common.Context.Cart when there is a view model available.

Best regards,


You must be logged in to post in the forum