Multi Store selection

2 years ago
Hello Friends,

I have installed and configured product for multi store, now I want to add a drop down list on top of the website so user can filter the product by switching the store name.

All these store are configured on same domain, so it will be great if someone can help me technically that how NopCommerce initialize current store so I can insert my code on that place.
2 years ago
The current store is set from reading the sub-domain
When a page loads it looks at        

        /// <summary>
        /// Gets or sets the current store
        /// </summary>
        public virtual Store CurrentStore
        {

In this routine it gets all the stores

        var allStores = _storeService.GetAllStores();

You could use these stubs to load up a drop-down box and display in the header

Then select the store you want from the dropdown then in the callback do a Redirect(Url) using the URL for the selected store
2 years ago
Thank you very much for your quickest reply.

My problem is, I have single domain for all the countries and I want to change the CurrentStore via code either based on IP to country sensing or changing the value from header drop down.

I populate the header drop down along with store id and creating a cookie whenever store is being selected. Now based on this cookie which contain selected store id, I want filter the product.

Please help or else do let me know the code location where NopCommerce select the default Store so I can insert my code there.

Thank you very much once again.