Overriding Product Extensions Class

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 年 前
Hello,

I want to override IsAvailable method in ProductExtensions class in my plugin, in order to add some extra controls but because of it's being a static class, I couldn't make it. Do you have any suggestion ?

Thanks in advance.
3 年 前
What is the ProductExtensions class ?
Do you mean ProductIsAvailable(...) in ProductService ?
3 年 前
@ElifFilikMete
What version of nopCommerce are you working with?  (3.90?  4.00?)
3 年 前
I am working with 3.90 version and there is no "ProductIsAvailable" method in Product Service in this version.
3 年 前
There maybe another way to do it ?

But unless you want to change the core then you need to go up a level and override a method in ProductController that calls IsAvailable
nopCommerce_3.90_Source\Presentation\Nop.Web\Controllers\ProductController.cs
Then either create you own IsAvailable or use the current one in conjunction with your extra controls
3 年 前
Thank you, as I couldn't find any other way, I override the ProductController in my plugin.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.