Close

Add settings to Ajax filters

TrexWebmaster
3 months ago
#14776 Quote
Avatar
  • 2
PM
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
3 months ago
#14779 Quote
Avatar
  • Moderator
  • 1413
PM
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,
Boyko Stanev
Nop-Templates.com
TrexWebmaster
3 months ago
#14780 Quote
Avatar
  • 2
PM
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
3 months ago
#14781 Quote
Avatar
  • Moderator
  • 1413
PM
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,
Boyko Stanev
Nop-Templates.com