Hey
I am trying to create a product picker item (sorta like the one you use in your newsletter on rapido). - and since it is not mentioned on the dokumentation page - I tried to follow the code mentioned by Morten here: https://doc.dynamicweb.com/forum/ecommerce-standard-features/ecommerce-standard-features/new-item-type
so if I build the following:
var products = Model.Item.GetValue("Products") as IList<Dynamicweb.Ecommerce.Frontend.ProductViewModel>; if (products.Any()) { <div> @foreach (var product in products) { <div>@product.ToJson()</div> } </div> }
I end up with the following:
{"Id":"PROD2","VariantId":"","LanguageId":"LANG1","Name":"testr","Number":"1231231231"}
Which is not a great deal of product values :) - if I try calling product.price.PriceFormattet or something similar it seems to just fail.
I can also see that Dynamicweb.Ecommerce.Frontend.ProductViewModel is deprecated, but changing it to Dynamicweb.Ecommerce.ProductCatalog.ProductViewModel results in 0 values as the type from the item is the deprecated one.
So any way of getting this to work? - The post I found is a bit older, so maybe there is a better way of doing this now.?