Skip to main content
To enable multiple stores, you will need to add the spree_multi_store gem to your project via:
bundle add spree_multi_store
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.
ResourceRelationship
OrderOne Order belongs to one Store
ProductOne Product can be associated with many Store(s), you can pick and choose in which Store(s) each Product will be available
Payment MethodOne Payment Method can be associated with many Store(s), you can select in which Stores given Payment Method will be available on Checkout
TaxonomyOne Taxonomy belongs to one Store
PromotionOne Promotion can be associated with multiple Stores
Store CreditOne 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 the current_store method which returns the Store matching the current URL. All parts of Spree (API, Admin Panel) have this implemented.
Under the hood current_store calls Spree::Stores::FindCurrent.new(url: url).execute.This logic can be easily overwritten by setting
Spree::Dependencies.current_store_finder = 'MyStoreFinderClass'
in config/initializers/spree.rb file

Default Store

If the system cannot find any Store that matches the current URL it will fall back to the Default Store. You can set the default Store via Rails console:
Spree::Store.find(2).update(default: true)
To get the default store in your code or rails console type:
Spree::Store.default

Custom Domains

Spree supports managing custom domains for Stores. In the Admin Panel, you can manage custom domains for each Store in the Settings -> Domains page.

Setup multi-store application

Follow the setup guide to get started.