spree_multi_vendor 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -9
- data/app/controllers/spree/admin/vendors_controller.rb +1 -13
- data/app/models/spree/vendor.rb +5 -10
- data/app/views/spree/admin/vendors/index.html.erb +3 -3
- data/app/views/spree/admin/vendors/translations.html.erb +3 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20231114090744_add_mobility_translations_to_vendor.rb +25 -0
- data/db/migrate/20231114093444_transfer_vendor_data_to_translatable_tables.rb +11 -0
- data/lib/spree_multi_vendor/configuration.rb +21 -4
- data/lib/spree_multi_vendor/version.rb +1 -1
- data/spree_multi_vendor.gemspec +1 -1
- metadata +14 -12
- data/app/overrides/spree/admin/shared/_main_menu.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 739faebda6a3b0fea3e9bb528131c08de2dde2f692dbca6b7346e8eaf0b5d9a1
|
4
|
+
data.tar.gz: 656938bba90616428bd534d7e64d94d2673e99a3ced0a8a2dfc0515d6eb4c0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639389fb453a10c7fc98328a6bcf1f8b4d834063f1be4983a5177a00e2dafcb447afc6d2f67095dd80ba716214546b645481703f131bffca8abd1214fd007125
|
7
|
+
data.tar.gz: 4d8c28520b08cc36c0fb130e77d566ff4aaeee9a63d971c52b8af6c61443047cddb2f18df2543c3b35b47e22c461f9d65b1d89a82825cf1c7c82ec5b6199aebf
|
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# Spree Multi Vendor
|
2
2
|
|
3
|
-
This is a
|
3
|
+
This is a spree [multi vendor marketplace](https://getvendo.com) 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.
|
4
4
|
|
5
5
|
## Developed by
|
6
6
|
|
7
7
|
[](https://getvendo.com?utm_source=spree_multi_vendor_github)
|
8
8
|
|
9
|
-
> All-in-one platform for all your Marketplace
|
9
|
+
> All-in-one platform for all your multi-vendor Marketplace needs. [Get your free account](https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github)
|
10
10
|
|
11
11
|
## Open source vs Vendo
|
12
12
|
|
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](
|
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](https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github).
|
14
14
|
|
15
15
|
| feature | open source | [vendo] |
|
16
16
|
|---|---|---|
|
@@ -168,14 +168,10 @@ and may be redistributed under the terms specified in the
|
|
168
168
|
|
169
169
|
## About Vendo
|
170
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>
|
174
|
-
|
175
171
|
> [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**.
|
176
172
|
|
177
173
|
> 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.
|
178
174
|
|
179
|
-
> [
|
175
|
+
> [Get your free account](https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github)
|
180
176
|
|
181
|
-
[vendo]:
|
177
|
+
[vendo]:https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
module Admin
|
3
3
|
class VendorsController < ResourceController
|
4
|
+
include Translatable
|
4
5
|
|
5
6
|
def create
|
6
7
|
if permitted_resource_params[:image]
|
@@ -13,7 +14,6 @@ module Spree
|
|
13
14
|
if permitted_resource_params[:image]
|
14
15
|
@vendor.create_image(attachment: permitted_resource_params.delete(:image))
|
15
16
|
end
|
16
|
-
format_translations if defined? SpreeGlobalize
|
17
17
|
super
|
18
18
|
end
|
19
19
|
|
@@ -51,18 +51,6 @@ module Spree
|
|
51
51
|
products: []
|
52
52
|
}
|
53
53
|
end
|
54
|
-
|
55
|
-
def format_translations
|
56
|
-
return if params[:vendor][:translations_attributes].blank?
|
57
|
-
params[:vendor][:translations_attributes].each do |_, data|
|
58
|
-
translation = @vendor.translations.find_or_create_by(locale: data[:locale])
|
59
|
-
translation.name = data[:name]
|
60
|
-
translation.about_us = data[:about_us]
|
61
|
-
translation.contact_us = data[:contact_us]
|
62
|
-
translation.slug = data[:slug]
|
63
|
-
translation.save!
|
64
|
-
end
|
65
|
-
end
|
66
54
|
end
|
67
55
|
end
|
68
56
|
end
|
data/app/models/spree/vendor.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module Spree
|
2
2
|
class Vendor < Spree::Base
|
3
3
|
extend FriendlyId
|
4
|
+
include TranslatableResource
|
5
|
+
include TranslatableResourceSlug
|
6
|
+
|
7
|
+
TRANSLATABLE_FIELDS = %i[name about_us contact_us slug].freeze
|
8
|
+
translates(*TRANSLATABLE_FIELDS)
|
4
9
|
|
5
10
|
acts_as_paranoid
|
6
11
|
acts_as_list column: :priority
|
@@ -48,16 +53,6 @@ module Spree
|
|
48
53
|
update(notification_email: email)
|
49
54
|
end
|
50
55
|
|
51
|
-
# Spree Globalize support
|
52
|
-
# https://github.com/spree-contrib/spree_multi_vendor/issues/104
|
53
|
-
if defined?(SpreeGlobalize)
|
54
|
-
attr_accessor :translations_attributes
|
55
|
-
translates :name,
|
56
|
-
:about_us,
|
57
|
-
:contact_us,
|
58
|
-
:slug, fallbacks_for_empty_translations: true
|
59
|
-
end
|
60
|
-
|
61
56
|
private
|
62
57
|
|
63
58
|
def create_stock_location
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
|
34
34
|
|
35
35
|
<% if @vendors.any? %>
|
36
|
-
<table class="table sortable" data-hook="vendors_table" data-sortable-link="<%= update_positions_admin_vendors_url %>">
|
36
|
+
<table class="table border rounded sortable" data-hook="vendors_table" data-sortable-link="<%= update_positions_admin_vendors_url %>">
|
37
37
|
<thead>
|
38
38
|
<tr data-hook="vendors_header">
|
39
39
|
<th>
|
@@ -66,9 +66,9 @@
|
|
66
66
|
<!-- Add translation icon support -->
|
67
67
|
<%= link_to_with_icon 'translate',
|
68
68
|
nil,
|
69
|
-
spree.
|
69
|
+
spree.translations_admin_vendor_path(vendor.id),
|
70
70
|
title: Spree.t(:'i18n.translations'),
|
71
|
-
class: 'btn btn-sm btn-primary'
|
71
|
+
class: 'btn btn-sm btn-primary' %>
|
72
72
|
</td>
|
73
73
|
</tr>
|
74
74
|
<% end %>
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
class AddMobilityTranslationsToVendor < ActiveRecord::Migration[6.1]
|
2
|
+
def change
|
3
|
+
if ActiveRecord::Base.connection.table_exists?('spree_vendor_translations')
|
4
|
+
if ActiveRecord::Migration.connection.index_exists?(:spree_vendors_translations, :spree_vendor_id)
|
5
|
+
remove_index :spree_vendor_translations, column: :spree_vendor_id, if_exists: true
|
6
|
+
end
|
7
|
+
else
|
8
|
+
create_table :spree_vendor_translations do |t|
|
9
|
+
# Translated attribute(s)
|
10
|
+
t.string :name
|
11
|
+
t.text :about_us
|
12
|
+
t.text :contact_us
|
13
|
+
t.string :slug
|
14
|
+
|
15
|
+
t.string :locale, null: false
|
16
|
+
t.references :spree_vendor, null: false, foreign_key: true, index: false
|
17
|
+
|
18
|
+
t.timestamps null: false
|
19
|
+
end
|
20
|
+
|
21
|
+
add_index :spree_vendor_translations, :locale, name: :index_spree_vendor_translations_on_locale
|
22
|
+
add_index :spree_vendor_translations, [:locale, :slug], unique: true, name: 'vendor_unique_slug_per_locale'
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class TransferVendorDataToTranslatableTables < ActiveRecord::Migration[6.1]
|
2
|
+
TRANSLATION_MIGRATION = Spree::TranslationMigrations.new(Spree::Vendor, 'en')
|
3
|
+
|
4
|
+
def up
|
5
|
+
TRANSLATION_MIGRATION.transfer_translation_data
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
TRANSLATION_MIGRATION.revert_translation_data_transfer
|
10
|
+
end
|
11
|
+
end
|
@@ -1,10 +1,27 @@
|
|
1
1
|
module SpreeMultiVendor
|
2
|
-
class Configuration
|
2
|
+
class Configuration
|
3
3
|
DEFAULT_VENDORIZED_MODELS ||= %w[product variant stock_location shipping_method].freeze
|
4
4
|
|
5
|
-
|
6
|
-
# https://guides.spreecommerce.org/developer/core/preferences.html
|
5
|
+
attr_accessor :vendorized_models
|
7
6
|
|
8
|
-
|
7
|
+
def initialize
|
8
|
+
self.vendorized_models = DEFAULT_VENDORIZED_MODELS
|
9
|
+
end
|
10
|
+
|
11
|
+
def configure
|
12
|
+
yield(self) if block_given?
|
13
|
+
end
|
14
|
+
|
15
|
+
def get(preference)
|
16
|
+
send(preference)
|
17
|
+
end
|
18
|
+
|
19
|
+
alias [] get
|
20
|
+
|
21
|
+
def set(preference, value)
|
22
|
+
send("#{preference}=", value)
|
23
|
+
end
|
24
|
+
|
25
|
+
alias []= set
|
9
26
|
end
|
10
27
|
end
|
data/spree_multi_vendor.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.require_path = 'lib'
|
30
30
|
s.requirements << 'none'
|
31
31
|
|
32
|
-
spree_version = '>= 4.
|
32
|
+
spree_version = '>= 4.6.0'
|
33
33
|
s.add_dependency 'spree', spree_version
|
34
34
|
s.add_dependency 'spree_backend', spree_version
|
35
35
|
s.add_dependency 'spree_emails', spree_version
|
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.5.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: 2023-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
26
|
+
version: 4.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_backend
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
33
|
+
version: 4.6.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
40
|
+
version: 4.6.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: spree_emails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 4.
|
47
|
+
version: 4.6.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 4.
|
54
|
+
version: 4.6.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: spree_extension
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,7 +162,6 @@ files:
|
|
162
162
|
- app/overrides/spree/admin/orders/index.rb
|
163
163
|
- app/overrides/spree/admin/products/form.rb
|
164
164
|
- app/overrides/spree/admin/products/new.rb
|
165
|
-
- app/overrides/spree/admin/shared/_main_menu.rb
|
166
165
|
- app/overrides/spree/admin/shared/_order_summary.rb
|
167
166
|
- app/overrides/spree/admin/users/_form.rb
|
168
167
|
- app/serializers/spree/v2/storefront/vendor_image_serializer.rb
|
@@ -177,6 +176,7 @@ files:
|
|
177
176
|
- app/views/spree/admin/vendors/edit.html.erb
|
178
177
|
- app/views/spree/admin/vendors/index.html.erb
|
179
178
|
- app/views/spree/admin/vendors/new.html.erb
|
179
|
+
- app/views/spree/admin/vendors/translations.html.erb
|
180
180
|
- app/views/spree/api/v1/vendors/index.rabl
|
181
181
|
- app/views/spree/api/v1/vendors/show.rabl
|
182
182
|
- app/views/spree/vendor_mailer/vendor_notification_email.html.erb
|
@@ -204,6 +204,8 @@ files:
|
|
204
204
|
- db/migrate/20210728120649_change_vendorized_models_vendor_id_type.rb
|
205
205
|
- db/migrate/20210728120910_change_vendor_id_and_user_id_type_for_spree_vendor_users.rb
|
206
206
|
- db/migrate/20210728121024_change_vendor_id_and_order_id_type_for_spree_order_commissions.rb
|
207
|
+
- db/migrate/20231114090744_add_mobility_translations_to_vendor.rb
|
208
|
+
- db/migrate/20231114093444_transfer_vendor_data_to_translatable_tables.rb
|
207
209
|
- lib/generators/spree_multi_vendor/install/install_generator.rb
|
208
210
|
- lib/generators/spree_multi_vendor/mailers_preview/mailers_preview_generator.rb
|
209
211
|
- lib/generators/spree_multi_vendor/mailers_preview/templates/mailers/previews/vendor_notification_preview.rb
|
@@ -250,9 +252,9 @@ licenses:
|
|
250
252
|
- BSD-3-Clause
|
251
253
|
metadata:
|
252
254
|
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.
|
255
|
+
changelog_uri: https://github.com/spree-contrib/spree_multi_vendor/releases/tag/v2.5.0
|
254
256
|
documentation_uri: https://guides.spreecommerce.org/
|
255
|
-
source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.
|
257
|
+
source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.5.0
|
256
258
|
post_install_message:
|
257
259
|
rdoc_options: []
|
258
260
|
require_paths:
|
@@ -269,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
271
|
version: '0'
|
270
272
|
requirements:
|
271
273
|
- none
|
272
|
-
rubygems_version: 3.
|
274
|
+
rubygems_version: 3.4.1
|
273
275
|
signing_key:
|
274
276
|
specification_version: 4
|
275
277
|
summary: Spree Commerce multi vendor marketplace extension
|
@@ -1,23 +0,0 @@
|
|
1
|
-
Deface::Override.new(
|
2
|
-
virtual_path: 'spree/admin/shared/_main_menu',
|
3
|
-
name: 'Display configuration tab for vendors',
|
4
|
-
replace: 'erb[silent]:contains("current_store")',
|
5
|
-
text: '<% if can?(:admin, current_store) || current_spree_user&.vendors&.any? %>'
|
6
|
-
)
|
7
|
-
Deface::Override.new(
|
8
|
-
virtual_path: 'spree/admin/shared/_main_menu',
|
9
|
-
name: 'vendors_main_menu_tabs',
|
10
|
-
insert_bottom: 'nav',
|
11
|
-
text: <<-HTML
|
12
|
-
<% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) %>
|
13
|
-
<ul class="nav nav-sidebar border-bottom">
|
14
|
-
<%= tab plural_resource_name(Spree::Vendor), url: admin_vendors_path, icon: 'money' %>
|
15
|
-
</ul>
|
16
|
-
<% end %>
|
17
|
-
<% if defined?(current_spree_vendor) && current_spree_vendor %>
|
18
|
-
<ul class="nav nav-sidebar border-bottom">
|
19
|
-
<%= tab Spree::Vendor.model_name.human, url: admin_vendor_settings_path, icon: 'money' %>
|
20
|
-
</ul>
|
21
|
-
<% end %>
|
22
|
-
HTML
|
23
|
-
)
|