Customizing a View that depends on a Plugin

9 месяцев назад
I'm developing a plugin to customize the appearance of specification attribute filters.

I have already created an additional domain model with properties to extend the specification attribute options (for example i can assign an image to each specification attribute option) in my plugin.

Now I would like to change the appearance of the filters to reflect those settings applied through the plugin (a user can click on an image instead of a checkbox). I see one way to do this, but am not happy with it:

Create a widget which reimplements the filter functionality and display it in the PublicWidgetZones.CategoryDetailsBeforeFilters widget zone. In the theme I will then simply delete the HTML rendering the current filter so I don't show filters twice. This works because in my situation I am in control of the theme AND the plugin, but I would prefer to avoid this.

Is there a better way to do this?
9 месяцев назад
I have not customized the filters, but I guess you could copy the existing filter .cshtml to you plugin, make the changes you like and then override the default filter with your own implementation.
9 месяцев назад
Hi, thanks for your answer.

In what way is your is suggestion different than mine? Would your way work without the need for a theme (everything done in plugin?)?
9 месяцев назад
It is different in the way that you leave the nopCommerce source code untouched, which is a more clean approach, it will also make updates easier in the future.

You can keep the all the changes in the plugin, and add whatever css or even themes if you have the need for your plugin to run in different sites.

Best regards,
Peter