質問

I want to display a text box and a button in each product page. The customer would enter his/her city name in the text box and click the button to know whether delivery is available for his/her city.

I learned I should I create a plugin/widget. But I am a little confused on which one to use? Plugin? Or a Widget?

What is the difference between a plugin and a widget in nopcommerce? What I should use here?

役に立ちましたか?

解決

Widget is a type of plugin in nopcommerce. A payment method for example is also a plugin, but not a widget.

Widget seems to be the type you want. See http://www.nopcommerce.com/docs/77/how-to-write-a-nopcommerce-plugin.aspx number 4 for more details. Here is description of widget:

b. IWidgetPlugin. It allows you to create widgets. Widgets are rendered on some parts of your site. For > example, it can be a "Live chat" block on the left column of your site.

他のヒント

I want go give you a more specific idea. According to nopCommerce blog link Plugin and widget are similar except a little bit change. A plugin extends base class BasePlugin to make administrative change under admin panel how ever a widget implements interface named IWidgetPlugin which performs design related issues in view layer most of the time. Each and every widget is one kind of plugin where as all plugin are not the widget in case of having some special properties.

Now what is that property?? In a widget as it works on a view layer so it's region is specific that means in which area it will be showed particularly and it's always call from a partial view.

But plugin do not define so. it may be a partial or a completely separate view.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top