GetWidgetZonesAsync not being called in custom Plugin

9 meses atrás
I am creating a plugin, which should extend the SpecificationAttributeOption Entity and show this additional data in a WidgetZone. My Plugin inherits from IWidgetPlugin and implements GetWidgetZonesAsync

        public Task<IList<string>> GetWidgetZonesAsync()
        {
            return Task.FromResult<IList<string>>(new List<string>
            {
                AdminWidgetZones.CustomerDetailsBlock,
                AdminWidgetZones.CustomerRoleDetailsTop,
                AdminWidgetZones.ProductListButtons,
                PublicWidgetZones.CheckoutConfirmTop,
                PublicWidgetZones.OpCheckoutConfirmTop,
                PublicWidgetZones.OrderSummaryContentBefore
            });
        }

just as I have seen it done in some other Plugins.

I have installed my plugin, and reach a breakpoint in it's constructor, but the GetWidgetZonesAsync Method is never called and therefore no widgets are ever rendered out. Am I missing some registration somewhere? What are the minimal steps required to get this method to be called?
9 meses atrás
Did you enable the Widget
See https://yourwebsite.com/Admin/Widget/List
9 meses atrás
You are correct, my widget was not active in the widget list. Is there a way to enable this by default when the plugin is installed?

Thank you for your help
9 meses atrás
Add to widgetsettings.activewidgetsystemnames at install

            if (!_widgetSettings.ActiveWidgetSystemNames.Contains(XXXXWidgetName))
            {
                _widgetSettings.ActiveWidgetSystemNames.Add(XXXXWidgetName);
                await _settingService.SaveSettingAsync(_widgetSettings);
            }
9 meses atrás
Thank you :)