Is there a bulk edit event, like there is a product save event

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 năm cách đây
Hi all,

Wondering if there is a bulk product edit save event.

I know there is one for the product save event.

using Nop.Core.Events;
using Nop.Services.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nop.Plugin.Feed.Froogle.Events
{
    public class BulkProductSaveConsumer : IConsumer<EntityFinalised<Product>>
    {
        public void HandleEvent(EntityFinalised<Product> eventMessage)
        {
        }
    }
}


Cheers
6 năm cách đây
You can use Actionfilter. If event is not there.

Thanks,
Jatin
6 năm cách đây
Hi Jatin,

Could you provide an example of how I might do this.
Can't seem to find a example that works.

Thanks for the help.
6 năm cách đây
Ok so this is the filter I need.

    
public class BulkEditOverideActionFilter : ActionFilterAttribute, IFilterProvider
    {
        public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
        {
            if (controllerContext.Controller is ProductController && actionDescriptor.ActionName.Equals("BulkEditUpdate", StringComparison.InvariantCultureIgnoreCase))
            {
                return new List<Filter>() { new Filter(this, FilterScope.Action, 0) };
            }
            return new List<Filter>();
        }

        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            //run code here
        }
    }


Thanks Jatin for pointing me on the right track :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.