Close

Add settings to Ajax filters

TrexWebmaster
5 years ago
#14776 Quote
Avatar
  • 2
Is there a way to add settings to the Ajax Filters?  I can add a setting in the admin (e.g., nopAjaxFiltersSettings.somenewsetting), but I don't know how to add it to the NopAjaxFiltersSettings.  I could inject the settings service in the view, but I'd rather not.

Thanks!

Jeremy
Boyko
5 years ago
#14779 Quote
Avatar
  • Moderator
  • 1570
TrexWebmaster wrote:
Is there a way to add settings to the Ajax Filters?  I can add a setting in the admin (e.g., nopAjaxFiltersSettings.somenewsetting), but I don't know how to add it to the NopAjaxFiltersSettings.  I could inject the settings service in the view, but I'd rather not.

Thanks!

Jeremy


Hi Jeremy,

You could not change the settings of the Ajax Filters plugin. To do so you will need the full source code of the plugin.

What setting do you want to add? You can always add a setting in the General Settings page and then use it via the Settings Service by key.
Regards,
Nop-Templates.com Team
TrexWebmaster
5 years ago
#14780 Quote
Avatar
  • 2
Hi!  I was actually able to use a view component to get my new settings this way (thanks to Anton at Nop Templates support for the idea).  

`var priceRangeFilterClassResult = await Component.InvokeAsync("NopAjaxFiltersSettingsExtend", new { CategoryId = currentCategoryId });`

Boyko
5 years ago
#14781 Quote
Avatar
  • Moderator
  • 1570
TrexWebmaster wrote:
Hi!  I was actually able to use a view component to get my new settings this way (thanks to Anton at Nop Templates support for the idea).  

`var priceRangeFilterClassResult = await Component.InvokeAsync("NopAjaxFiltersSettingsExtend", new { CategoryId = currentCategoryId });`



Hi TrexWebmaster,

Yes, that is another way to do it! Good job!
Regards,
Nop-Templates.com Team