How to create a Custom Action Filter in nopCommerce v4

Posted: November 30, 2017 at 5:34 AM Quote #197029
Just started to upgrade one of our sites to v4.0 and been through the process of upgrading the Action Filters. Thought someone else might interested in this, so I created (my first) a blog post:

http://blog.majako.net/how-to-create-a-custom-action-filter-in-nopcommerce-v4/

Any feedback appreciated!
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
http://www.majako.net

https://github.com/martingust
Posted: November 30, 2017 at 6:19 AM Quote #197030
Hello,

This is appreciated. We are using this from a long time but it is good to see someone shared a nice written blog on it.
This post/answer is useful
-1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Thank's,
Atul Rungta
====================================================
Skype: atulrungta
Email: [email protected]
Site: http://nopadvance.com

For project inquiries: [email protected]

Surat, Gujarat - INDIA
@ * Save paper {Save Trees} *@
Posted: November 30, 2017 at 7:51 AM Quote #197036
You can also implement INopStartup

https://www.nopcommerce.com/boards/t/49255/how-can-i-register-a-global-action-filter-from-my-plugin-in-nopcommere-40.aspx
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 30, 2017 at 11:44 PM Quote #197070
timmit wrote:
You can also implement INopStartup

https://www.nopcommerce.com/boards/t/49255/how-can-i-register-a-global-action-filter-from-my-plugin-in-nopcommere-40.aspx


Thanks, I updated the post to take this approach instead.
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
http://www.majako.net

https://github.com/martingust
Posted: December 01, 2017 at 12:57 AM Quote #197074
Very nice, by using the generic filter Add method there is no need to manually instantiate the filter class and DI will handle constructor injection.


public void ConfigureServices(IServiceCollection services, IConfigurationRoot configuration)
        {
            services.Configure<MvcOptions>(config =>
            {              
                config.Filters.Add<ProductDetailsActionFilter>();
            });
        }
This post/answer is useful
2
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
http://www.majako.net

https://github.com/martingust
Posted: March 08, 2018 at 5:11 AM Quote #201677
I followed your guide, but the filter is called in all stores even if it is limited to only one of them.

How can I limit the filter to just one store?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: July 31, 2018 at 7:48 AM Quote #209639
mgustafsson

This link http://blog.majako.net/how-to-create-a-custom-action-filter-in-nopcommerce-v4/

Doesn't work!

Can this be fixed?
Please
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 05, 2018 at 9:41 AM Quote #213969
Hemyl wrote:
mgustafsson

This link http://blog.majako.net/how-to-create-a-custom-action-filter-in-nopcommerce-v4/

Doesn't work!

Can this be fixed?
Please


Article is moved to:

http://www.majako.net/how-to-create-a-custom-action-filter-in-nopcommerce-v4/
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
http://www.majako.net

https://github.com/martingust
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.