spree_multi_vendor 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +28 -24
- data/app/controllers/spree/api/v1/vendors_controller.rb +1 -1
- data/app/controllers/spree_multi_vendor/spree/api/base_controller_decorator.rb +2 -2
- data/app/controllers/spree_multi_vendor/spree/api/v1/products_controller_decorator.rb +1 -1
- data/app/controllers/spree_multi_vendor/spree/api/v1/users_controller_decorator.rb +1 -1
- data/app/helpers/spree_multi_vendor/spree/api/api_helpers_decorator.rb +1 -1
- data/app/models/spree/vendor.rb +1 -1
- data/app/models/spree_multi_vendor/spree/variant_decorator.rb +0 -1
- data/app/overrides/spree/admin/users/_form.rb +1 -1
- data/app/views/spree/admin/vendors/index.html.erb +1 -1
- data/config/initializers/spree_permitted_attributes.rb +0 -2
- data/db/migrate/20210728120910_change_vendor_id_and_user_id_type_for_spree_vendor_users.rb +7 -1
- data/db/migrate/20210728121024_change_vendor_id_and_order_id_type_for_spree_order_commissions.rb +7 -1
- data/{app/models → lib}/spree_multi_vendor/configuration.rb +0 -0
- data/lib/spree_multi_vendor/engine.rb +10 -0
- data/lib/spree_multi_vendor/version.rb +1 -1
- data/lib/spree_multi_vendor.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5387ab5edeed4f158bfb7e5f264800ea5b02efc14c2048957501948c406dcca
|
4
|
+
data.tar.gz: 523fd3aea41eea77295a9f34d33ee3bcfb08dd9b615ddba74eda769b8e65f326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a8768042a152773ff4059c05c4e49f5102048cc3538e0289a9f015daa4afe0bae20124bbd8a96f61bb4d2a6f48033b4c4f2cbefcc1650c1e1ff83211f6b20b6
|
7
|
+
data.tar.gz: 97901fc6622e7d5c208656630865c01da883cac4ee158309b62bce59984c69357b971a128257dca459e556ced2097ce3ecb5aec664b297ebeb0eaffb31dc2b18
|
data/README.md
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
# Spree Multi Vendor
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.com/spree-contrib/spree_multi_vendor.svg?branch=master)](https://travis-ci.com/spree-contrib/spree_multi_vendor)
|
4
|
-
|
5
3
|
This is a [spree multi vendor marketplace](https://spreecommerce.org/use-cases/multi-vendor-marketplace/) extension. It's a great starting point if you're building a marketplace on top of [Spree](https://spreecommerce.org). Our goal was flexibility to allow you to tweak it to your needs.
|
6
4
|
|
7
|
-
|
8
|
-
|
9
|
-
Developed and maintained by:
|
5
|
+
## Developed by
|
10
6
|
|
11
|
-
[![
|
7
|
+
[![Vendo](https://assets-global.website-files.com/6230c485f2c32ea1b0daa438/623372f40a8c54ca9aea34e8_vendo%202.svg)](https://getvendo.com?utm_source=spree_multi_vendor_github)
|
12
8
|
|
13
|
-
|
9
|
+
> All-in-one platform for all your Marketplace and B2B eCommerce needs. [Start your 30-day free trial](https://e98esoirr8c.typeform.com/contactvendo?typeform-source=spree_multi_vendor_github)
|
14
10
|
|
15
|
-
|
11
|
+
## Open source vs Vendo
|
16
12
|
|
17
|
-
- [
|
18
|
-
- [X] Products
|
19
|
-
- [X] Stock Locations
|
20
|
-
- [X] Shipping Methods
|
21
|
-
- [X] Vendor profile
|
13
|
+
If you need a product that has all of the features out of the box, such us supplier onboarding, Stripe connect payment splitting and payouts, and don't require any custom development - we recommend using [Vendo](http://getvendo.com?utm_source=spree_multi_vendor_github) which is also based on Spree.
|
22
14
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
15
|
+
| feature | open source | [vendo] |
|
16
|
+
|---|---|---|
|
17
|
+
| basic vendorization | ✔️ | ✔️ |
|
18
|
+
| supplier onboarding | | ✔️ |
|
19
|
+
| supplier dashboard | | ✔️ |
|
20
|
+
| supplier management | | ✔️ |
|
21
|
+
| supplier product curation | | ✔️ |
|
22
|
+
| automatic payment splitting | | ✔️ |
|
23
|
+
| automatic payouts | | ✔️ |
|
24
|
+
| Afterpay / klarna / apple pay | | ✔️ |
|
25
|
+
| shopify / bigcommerce / woocommerce integration | | ✔️ |
|
26
|
+
| USPS, UPS, FedEx, DHL, and more | | ✔️ |
|
27
|
+
| bulk upload / import of products from CSV and XSLX | | ✔️ |
|
28
|
+
| bulk export of orders, shipments and more | | ✔️ |
|
28
29
|
|
29
30
|
## Installation
|
30
31
|
|
@@ -165,13 +166,16 @@ and may be redistributed under the terms specified in the
|
|
165
166
|
|
166
167
|
[LICENSE]: https://github.com/spark-solutions/spree_braintree_vzero/blob/master/LICENSE
|
167
168
|
|
168
|
-
## About
|
169
|
+
## About Vendo
|
170
|
+
|
171
|
+
<a href="https://getvendo.com?utm_source=spree_multi_vendor_github">
|
172
|
+
<img src="https://uploads-ssl.webflow.com/6230c485f2c32ea1b0daa438/62386b96518cdcbe111f134a_OG%20Image%20(2).png" style="max-height:400px" />
|
173
|
+
</a>
|
169
174
|
|
170
|
-
[
|
175
|
+
> [Vendo][vendo] is a great fit for marketplaces of all sizes - either with own fulfillment and multiple warehouses or in a dropshipping model. Vendo **automates everything** from **vendor onboarding**, accepting buyer **payments in over 135 currencies**, to supplier **payouts in 50 countries**.
|
171
176
|
|
172
|
-
|
177
|
+
> Vendo ensures excellent buyer experience with smooth product discovery and search, a multitude of payment methods and optimal shipping cost calculation. Vendo keeps suppliers happy with easy onboarding, automated products sync using their preferred method and easy payouts.
|
173
178
|
|
174
|
-
|
175
|
-
We are [available for hire][spark].
|
179
|
+
> [Start your 30-day free trial](https://e98esoirr8c.typeform.com/contactvendo?typeform-source=spree_multi_vendor_github)
|
176
180
|
|
177
|
-
[
|
181
|
+
[vendo]:http://getvendo.com?utm_source=spree_multi_vendor_github
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module SpreeMultiVendor::Spree::Api::BaseControllerDecorator
|
2
|
-
Spree::Api::BaseController.include(Spree::Api::VendorHelper)
|
2
|
+
Spree::Api::V1::BaseController.include(Spree::Api::VendorHelper) if SpreeMultiVendor::Engine.api_v1_available?
|
3
3
|
|
4
4
|
def self.prepended(base)
|
5
5
|
base.helper_method :current_spree_vendor
|
@@ -14,4 +14,4 @@ module SpreeMultiVendor::Spree::Api::BaseControllerDecorator
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
::Spree::Api::BaseController.prepend SpreeMultiVendor::Spree::Api::BaseControllerDecorator
|
17
|
+
::Spree::Api::V1::BaseController.prepend SpreeMultiVendor::Spree::Api::BaseControllerDecorator if SpreeMultiVendor::Engine.api_v1_available?
|
@@ -6,4 +6,4 @@ module SpreeMultiVendor::Spree::Api::V1::ProductsControllerDecorator
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
Spree::Api::V1::ProductsController.prepend SpreeMultiVendor::Spree::Api::V1::ProductsControllerDecorator
|
9
|
+
Spree::Api::V1::ProductsController.prepend SpreeMultiVendor::Spree::Api::V1::ProductsControllerDecorator if SpreeMultiVendor::Engine.api_v1_available?
|
@@ -10,4 +10,4 @@ module SpreeMultiVendor::Spree::Api::V1::UsersControllerDecorator
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
Spree::Api::V1::UsersController.prepend SpreeMultiVendor::Spree::Api::V1::UsersControllerDecorator
|
13
|
+
Spree::Api::V1::UsersController.prepend SpreeMultiVendor::Spree::Api::V1::UsersControllerDecorator if SpreeMultiVendor::Engine.api_v1_available?
|
data/app/models/spree/vendor.rb
CHANGED
@@ -61,7 +61,7 @@ module Spree
|
|
61
61
|
private
|
62
62
|
|
63
63
|
def create_stock_location
|
64
|
-
stock_locations.where(name: name, country: Spree::
|
64
|
+
stock_locations.where(name: name, country: Spree::Store.default.default_country).first_or_create!
|
65
65
|
end
|
66
66
|
|
67
67
|
def should_generate_new_friendly_id?
|
@@ -7,7 +7,6 @@ module SpreeMultiVendor::Spree::VariantDecorator
|
|
7
7
|
|
8
8
|
def vendor
|
9
9
|
@vendor ||= if self.class.reflect_on_association(:vendor) && self[:vendor_id].present?
|
10
|
-
product.vendor
|
11
10
|
::Spree::Vendor.unscoped.find(self[:vendor_id])
|
12
11
|
elsif Spree::Product.reflect_on_association(:vendor) && product.vendor_id.present?
|
13
12
|
product.vendor
|
@@ -5,7 +5,7 @@ Deface::Override.new(
|
|
5
5
|
text: <<-HTML
|
6
6
|
<% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) %>
|
7
7
|
<%= f.field_container :vendor_ids, class: ['form-group'] do %>
|
8
|
-
<%= f.label :vendor_ids,
|
8
|
+
<%= f.label :vendor_ids, plural_resource_name(Spree::Vendor) %>
|
9
9
|
<%= f.collection_select(:vendor_ids, Spree::Vendor.all, :id, :name, { }, { class: 'select2', multiple: true }) %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
@@ -6,7 +6,5 @@ module Spree
|
|
6
6
|
|
7
7
|
@@vendor_attributes = [:name, :about_us, :contact_us, :notification_email]
|
8
8
|
@@vendor_attributes << :image if Spree.version.to_f >= 3.6
|
9
|
-
|
10
|
-
@@product_attributes << :vendor_id if SpreeMultiVendor::Config[:vendorized_models].include?('product')
|
11
9
|
end
|
12
10
|
end
|
@@ -1,8 +1,14 @@
|
|
1
1
|
class ChangeVendorIdAndUserIdTypeForSpreeVendorUsers < ActiveRecord::Migration[4.2]
|
2
|
-
def
|
2
|
+
def up
|
3
3
|
change_table(:spree_vendor_users) do |t|
|
4
4
|
t.change :vendor_id, :bigint
|
5
5
|
t.change :user_id, :bigint
|
6
6
|
end
|
7
7
|
end
|
8
|
+
def down
|
9
|
+
change_table(:spree_vendor_users) do |t|
|
10
|
+
t.change :vendor_id, :integer
|
11
|
+
t.change :user_id, :integer
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
data/db/migrate/20210728121024_change_vendor_id_and_order_id_type_for_spree_order_commissions.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
class ChangeVendorIdAndOrderIdTypeForSpreeOrderCommissions < ActiveRecord::Migration[4.2]
|
2
|
-
def
|
2
|
+
def up
|
3
3
|
change_table(:spree_order_commissions) do |t|
|
4
4
|
t.change :vendor_id, :bigint
|
5
5
|
t.change :order_id, :bigint
|
6
6
|
end
|
7
7
|
end
|
8
|
+
def down
|
9
|
+
change_table(:spree_order_commissions) do |t|
|
10
|
+
t.change :vendor_id, :integer
|
11
|
+
t.change :order_id, :integer
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
File without changes
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require_relative 'configuration'
|
2
|
+
|
1
3
|
module SpreeMultiVendor
|
2
4
|
class Engine < Rails::Engine
|
3
5
|
require 'spree/core'
|
@@ -13,12 +15,20 @@ module SpreeMultiVendor
|
|
13
15
|
SpreeMultiVendor::Config = SpreeMultiVendor::Configuration.new
|
14
16
|
end
|
15
17
|
|
18
|
+
config.after_initialize do
|
19
|
+
::Spree::PermittedAttributes.product_attributes << :vendor_id if SpreeMultiVendor::Config[:vendorized_models].include?('product')
|
20
|
+
end
|
21
|
+
|
16
22
|
def self.activate
|
17
23
|
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
18
24
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
19
25
|
end
|
20
26
|
end
|
21
27
|
|
28
|
+
def self.api_v1_available?
|
29
|
+
@@api_v1_available ||= Gem::Specification.find_all_by_name('spree_api_v1').any?
|
30
|
+
end
|
31
|
+
|
22
32
|
config.to_prepare &method(:activate).to_proc
|
23
33
|
end
|
24
34
|
end
|
data/lib/spree_multi_vendor.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_multi_vendor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spark Solutions
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree
|
@@ -148,7 +148,6 @@ files:
|
|
148
148
|
- app/models/spree/vendor_image.rb
|
149
149
|
- app/models/spree/vendor_order_totals.rb
|
150
150
|
- app/models/spree/vendor_user.rb
|
151
|
-
- app/models/spree_multi_vendor/configuration.rb
|
152
151
|
- app/models/spree_multi_vendor/spree/ability_decorator.rb
|
153
152
|
- app/models/spree_multi_vendor/spree/base_decorator.rb
|
154
153
|
- app/models/spree_multi_vendor/spree/line_item_decorator.rb
|
@@ -209,6 +208,7 @@ files:
|
|
209
208
|
- lib/generators/spree_multi_vendor/mailers_preview/mailers_preview_generator.rb
|
210
209
|
- lib/generators/spree_multi_vendor/mailers_preview/templates/mailers/previews/vendor_notification_preview.rb
|
211
210
|
- lib/spree_multi_vendor.rb
|
211
|
+
- lib/spree_multi_vendor/configuration.rb
|
212
212
|
- lib/spree_multi_vendor/engine.rb
|
213
213
|
- lib/spree_multi_vendor/factories.rb
|
214
214
|
- lib/spree_multi_vendor/version.rb
|
@@ -250,9 +250,9 @@ licenses:
|
|
250
250
|
- BSD-3-Clause
|
251
251
|
metadata:
|
252
252
|
bug_tracker_uri: https://github.com/spree-contrib/spree_multi_vendor/issues
|
253
|
-
changelog_uri: https://github.com/spree-contrib/spree_multi_vendor/releases/tag/v2.
|
253
|
+
changelog_uri: https://github.com/spree-contrib/spree_multi_vendor/releases/tag/v2.4.0
|
254
254
|
documentation_uri: https://guides.spreecommerce.org/
|
255
|
-
source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.
|
255
|
+
source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.4.0
|
256
256
|
post_install_message:
|
257
257
|
rdoc_options: []
|
258
258
|
require_paths:
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
version: '0'
|
270
270
|
requirements:
|
271
271
|
- none
|
272
|
-
rubygems_version: 3.
|
272
|
+
rubygems_version: 3.0.9
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: Spree Commerce multi vendor marketplace extension
|