detect if article has property by propertyname #162
-
I wanted to use some custom properties to tell the product display template to show certain icons. i,e, Then in template whatever icon/logo want to show
}
I'm doing this in ProductDisplayDetail.cshtml Can this be done? if so how? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Categories and properties are both CATEGORY records. They are linked by the GROUP record. I believe you're looking at calling the ProductData.GetCategories func which will allow you to get a List of properties per your needs. It takes a groupref string param that is useful for getting at specific properties. https://github.com/openstore-ecommerce/OpenStore/blob/master/Components/Product/ProductData.cs
You can iterate the properties or use LINQ to evaluate things once you've got the data. You could do this in your Razor template or you might do it in a custom token for little more separation and re-usability. |
Beta Was this translation helpful? Give feedback.
-
Awesome. Thanks for posting it back. |
Beta Was this translation helpful? Give feedback.
Awesome. Thanks for posting it back.