How to call plugin settings in Nop.Web?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hello,

I'm trying to call some settings I set in my plugin, using ISettingService; how would I go about calling this from a controller in Nop.Web?  If I instantiate my plugin model, I will get the default values (so it doesn't use the ISettingService).

Thanks for the help.
10 years ago
ahill775 wrote:
Hello,

I'm trying to call some settings I set in my plugin, using ISettingService; how would I go about calling this from a controller in Nop.Web?  If I instantiate my plugin model, I will get the default values (so it doesn't use the ISettingService).

Thanks for the help.


Did you mean how do you get the settings of your plugin? You better not, because a plugin being a plugin means that the host knows very little about it. For the host to be tied to a plugin defeats the plugin's purpose. What do you really want to do? I am sure there is a workaround. :)
10 years ago
Hi thank you for the reply.

Basically we're trying to configure the time frame of sales that are considered bestsellers on the homepage.  We're trying to call the months set in the plugin configuration to modify the months from which bestsellers are listed.

So:
if (this.product == bestseller && this.product.lastSold < plugin.monthsLimit)
{
    show.thisBestSeller;
}

Basically that's what we're trying to do, but yes with plugin injection if possible.
10 years ago
Ok, so I had to do some reading on dependency injection, but basically I had to create a service folder in my plugin, and override methods in one of the Nop.Services folders.  It actually was fairly easy to figure out, and involved replicating and editing the method that actually ran the methods that was called for bestsellers, rather than editing the implementation that called the method itself.

Fully working plugin now, hopefully this will help someone out.
6 years ago
Admin area > Configuration > Settings >Customer Settings

How to read value of this page Inputs. Like there Registration method Combo value in my Plugin?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.