I've created a category for Free Shipping. Now I want to display the standard NOP Free Shipping div on the Product Detail page whenever the product is in the category Free Shipping. What is the simplest to look up whether the product is a member of the Free Shipping category?
Thank you in advance for your advice and assistance.
As always your replies are spot on. Thank you for the code. I inserted it into the ProductTemplate.Simple.cshtml view, where it works great.
One last question. I really wanted to have the Free Shipping category non-published. GetProductCategoriesByProductId only returns published categories (by good design).
Is there a way to query against a non-published category, even if it means querying directly against the categoryId of the Free Shipping category?
If not, I'll live with having the category published.
One last question. I really wanted to have the Free Shipping category non-published. GetProductCategoriesByProductId only returns published categories (by good design).
Is there a way to query against a non-published category, even if it means querying directly against the categoryId of the Free Shipping category?
The GetProductCategoriesByProductId method takes a second optional parameter called showHidden that also returns unpublished categories. So just pass a second parameter with a value of true: