Posts

Showing posts from June, 2024

Episerver Commerce: Creating a new block

Image
Refer to this blog post:  https://world.optimizely.com/blogs/david-harlow/dates/2018/3/extending-commerce---content-area-functionality/ By default, content areas in Episerver commerce items such as products and variants don't display the option for creating a new block, and only allows for blocks to be dragged in, as seen below. However, an extremely simple solution to change this default behavior is to inherit from IResourceable on your product/variant which will require the interface member ContentAssetsID to be declared which can simply be scaffolded to false, and this will be all the code required to display the content area as expected! public class FashionProduct : ProductContent, IResourceable {      [Editable(false)]      [ScaffoldColumn(false)]      public virtual string ProductContentAssetId { get; set; }      [Ignore]      public Guid ContentAssetsID ...