Restrict variant types in bundle

Vote:
 

Hi,

Let's say I want to create a very specific bundle type and only allow certain types of variants to be added to it. Is there an out of the box solution to restrict which variant types an editor can add to a bundle?

#190801
Apr 17, 2018 10:36
Vote:
 

Hi,

Basically you can use AvailableContentTypes attribute, something like:

[CatalogContentType(
        GUID = "f20a74d6-5dfe-4116-8243-119c7bfe667f",
        DisplayName = "MyBundle",
        AvailableInEditMode = false)]
[AvailableContentTypes(Include = new[] { typeof(Variant1), typeof(Variant2) })]
public class MyBundle : BundleContent
{
}

Regards,

/Bien

#190808
Apr 17, 2018 12:29
Vote:
 

Hi,

Basically you can use AvailableContentTypes attribute, something like:

[CatalogContentType(
        GUID = "f20a74d6-5dfe-4116-8243-119c7bfe667f",
        DisplayName = "MyBundle",
        AvailableInEditMode = false)]
[AvailableContentTypes(Include = new[] { typeof(Variant1), typeof(Variant2) })]
public class MyBundle : BundleContent
{
}

Regards,

/Bien

#190809
Apr 17, 2018 12:29
Vote:
 

Works like a charm, thanks!

#190811
Apr 17, 2018 12:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.