Multi Store selection

Posted: April 25, 2018 at 1:13 AM Quote #203623
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: April 25, 2018 at 3:04 AM Quote #203631
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
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.SelectSystems.com.au
Select Systems International is a computer systems technology solution developer and integration service provider.
Posted: April 25, 2018 at 8:38 AM Quote #203644
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.