This is a spree multi vendor marketplace extension. It's a great starting point if you're building a marketplace on top of Spree. Our goal was flexibility to allow you to tweak it to your needs.
Check out this extension multi vendor marketplace demo and launch your marketplace within weeks, not months.
Developed and maintained by:
By default you can create and manage Vendors who can manage on their own:
- Orders
- Products
- Stock Locations
- Shipping Methods
- Vendor profile
Also:
- Super Admins can assign Users to Vendors
- You can modify which permissions and models/resources Vendors can manage quite easily
Contributions welcome! :)
-
Add this extension to your Gemfile with this line:
gem 'spree_multi_vendor'
-
Install the gem using Bundler:
bundle install
-
Copy & run migrations
bundle exec rails g spree_multi_vendor:install
-
Restart your server
If your server was running, restart it so that it can find the assets properly.
-
Optionally you can also create sample Vendor by running:
bundle exec rake spree_multi_vendor:sample:create
-
Fetch new database migrations:
bundle exec rake railties:install:migrations FROM=spree_multi_vendor
-
Run migrations
bundle exec rails db:migrate
To change which models should be vendorized, in your Spree initializer (config/initializers/spree.rb
) add:
SpreeMultiVendor::Config[:vendorized_models] = %w[product variant stock_location shipping_method other_model]
This will lookup for Spree::OtherModel
class. To add vendor_id
column to that model run:
bundle exec rails g migration AddVendorToSpreeOtherModels vendor:references
Spree Multi Vendor adds new API v2 endpoints:
-
GET
Display Vendor information endpoint/api/v2/storefront/vendors/<vendor_slug>
eg.
/api/v2/storefront/vendors/test-vendor
you can also include Vendor image and/or Products in that call:
/api/v2/storefront/vendors/test-vendor?include=image,products
-
GET
Returns a list of Vendors/api/v2/storefront/vendors
you can also include Vendor image and/or Products in that call:
/api/v2/storefront/vendors?include=image,products
And modfies existing:
-
GET
Filtering Products by Vendor ID(s):/api/v2/storefront/products?filter[vendor_ids]=1,2,3
-
GET
Include Vendor information in Cart endpoint:/api/v2/storefront/cart?include=vendors,vendor_totals
Spree offers emails preview generator for development purposes. To generate them, use command:
bundle exec rails g spree_multi_vendor:mailers_preview
After that, start rails server locally and go to:
localhost:3000/rails/mailers
(it requires seeded development database in order to work properly)
First bundle your dependencies, then run rake
. rake
will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app
.
bundle
bundle exec rake
When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:
require 'spree_multi_vendor/factories'
If you'd like to contribute, please take a look at the instructions for installing dependencies and crafting a good pull request.
Spree Multi Vendor is copyright © 2017-2021 Spark Solutions Sp. z o.o.. It is free software, and may be redistributed under the terms specified in the LICENCE file.
Spree Vendors is maintained by Spark Solutions Sp. z o.o.
We are passionate about open source software. We are available for hire.