BaseProduct.IsPublished returns incorrect result

When un-publishing a product that has previously been published, the result returned from the BaseProduct.IsPublished() function remains “True” while I we would expect this to be “False”.
Is this correct? Should the result not be “False”? Is there another way to determine if this product IS published or not?

Litium version: 5.6.8-patch-1905131320

Does the URL exist on the base product or on the variant in your case?

In my testing IsPublished works as expected on products where the URL is on the variant, but not when it’s on the base product.

You could use the extension method GetPublishedVariants to check if the base product has any published variants and set your status from there. It won’t check if it has category and if that is published, but maybe it’s enough for you use case.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.