Posted on 04/10/2019 16:35:36
Hi Nicolai and Morten,
Thank you for your help. I can confirm that it works when we updated the Ecommerce DLL.
However, now we are facing a new challenge, as we want to be able to show variants on a product. The variant related properties available on the view model are:
- Variants (list is empty, although the tested product has variants)
- VariantCombinations (list is not empty)
- VariantId
In our case we need to be able to sort the variants on variant groups, so it would be nice to have a VariantGroups list available on the view model as well. For now, we are using the workaround shown below.
private static readonly ProductService productService = new ProductService();
public static IEnumerable<VariantGroup> GetVariantGroups(this ProductViewModel productVm)
{
var product = productService.GetProductById(productVm.Id, productVm.VariantId, true);
return product.VariantGroups;
}
Best regards,
Roald