1

I want to show user selected store and category on product detail page like this Store Name Category Name > Product Name. How can I get user selected store and category from Product detail page. I use nopCommerce 3.0.

4

2 回答 2

4

For the store name, you can use the store context object:

_storeContext.CurrentStore

But for the category, are you aware that a product can belong to multiple categories in nopCommerce? This is stored in the ProductCategories collection of the Product entity.

于 2013-05-25T14:59:11.997 回答
0

I have a problem with

_storeContext.CurrentStore

This everytime gives me wrong store information and the reason is described here

plugin-get-current-storeid-multi-store

So i have used the below code which i got from looking NivoSlider Plugin .

var storeScope = this.GetActiveStoreScopeConfiguration(_storeService, _workContext);

_storeService is type of IStoreService

_workContext is type of IWorkContext

Use it via dependency injection from constructor.

于 2016-09-18T19:03:24.200 回答