I have a problem when trying to get ProductInfo when you have variants. They have a GUID and that does not seem to work when trying to get TypedContent.
Is this a general problem or did I miss something?
That is because when using variants from the variant property editor with Tea Commerce - each variant have a GUID as the id and the product identifier will be the node id of Umbraco + "_" + variant GUID.
Use the following code to get a ProductIdentifier object.
using TeaCommerce.Umbraco.Configuration.Variants.Models;
IPublishedContent productContent = Umbraco.TypedContent( new ProductIdentifier(orderLine.ProductIdentifier).NodeId );
Getting Productinfo for Variants?
I have a problem when trying to get ProductInfo when you have variants. They have a GUID and that does not seem to work when trying to get TypedContent.
Is this a general problem or did I miss something?
This gives me null
Hi Marcus
That is because when using variants from the variant property editor with Tea Commerce - each variant have a GUID as the id and the product identifier will be the node id of Umbraco + "_" + variant GUID.
Use the following code to get a ProductIdentifier object.
Kind regards
Anders
is working on a reply...