spree_multi_store gem to your project via:
Spree Multi-Store is licensed under the AGPL v3 License.If you would like to use it in a commercial application, please contact us to obtain a commercial license.

Store resources
Each Store can have its own resources. For example, a Store can have its own Products, Taxonomies, Promotions, etc.| Resource | Relationship |
|---|---|
| Order | One Order belongs to one Store |
| Product | One Product can be associated with many Store(s), you can pick and choose in which Store(s) each Product will be available |
| Payment Method | One Payment Method can be associated with many Store(s), you can select in which Stores given Payment Method will be available on Checkout |
| Taxonomy | One Taxonomy belongs to one Store |
| Promotion | One Promotion can be associated with multiple Stores |
| Store Credit | One Store Credit belongs to and can be used in one Store |
Current Store
Spree will try to determine the current store based on the current URL. If the URL does not match any of the stores in the database, Spree will fall back to the default store. All Spree controllers or any other controllers that include Spree::Core::ControllerHelpers::Store have access to thecurrent_store method which returns the Store matching the current URL.
All parts of Spree (API, Admin Panel) have this implemented.
Under the hood in
current_store calls Spree::Stores::FindCurrent.new(url: url).execute.This logic can be easily overwritten by settingconfig/initializers/spree.rb file
