Get product attribute values from product variant

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 Jahre weitere
Hi,

I am trying to get the product attribute values for a given product variant.  

However everytime i set the code to run, it returns object reference not set to an instance of an object.

Does anyone see where im going wrong please?

ProductAttributeService pas = new ProductAttributeService(_context);
var productVariantAttributeValues = pas.GetProductVariantAttributeValues(productVariant.ProductVariantId); //errors here
foreach( var pva in productVariantAttributeValues )
            {
                if (pva.IsTaxExempt)
                {
                    return true;
                }
            }
13 Jahre weitere
The code is trying to access a member of a reference type variable that is set to null. Try to debug this source code and find which member is null (perhaps, 'productVariant')
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.