spree_multi_vendor 2.3.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc35d0a2ae81399b7daa7f806f69725d71bfb5f7ea5b54ff0680d4b95e93e9e9
4
- data.tar.gz: a19370e4fc2ae70fd6749ae829560d250ebb579844132d8fa9766043c0374c72
3
+ metadata.gz: 956455a7ff13df68945b50b576880f345e2dbd4f5c4c32dc99420f0a1c5698e7
4
+ data.tar.gz: 8daf1f4488fad039a96e4c43a2211521d5b15297c5e628f018368d38fca70121
5
5
  SHA512:
6
- metadata.gz: 6d55aa0438bf0ef0005320b21b90417370b388502b0b6a8957e5f291b988dd0b8b6c486e3d785360cb4c853b36ce978e5b972dee0a609eb5867435cc40aa532b
7
- data.tar.gz: fbb4c2094e074e06edee73ea7338ddcac6d6d800ab1810d3134efdcd5283c0d3976161f7aa9b5803e79ad58e3cc68e71b690aa48e6a4397243c838db3b63f085
6
+ metadata.gz: 6b10eaa1316ee480d4b8b2e456e1648b3da2b01561effa253c65671de1963e3cb7369c1a061a4a298d443f5be4c018a7d9fff45d0a0514a2115f17f400f4fbf6
7
+ data.tar.gz: ad4aac2625a258d534c9fa553a8261907601443a53859ef55e4e76523c6868c59083dac7904026741dc040b3b80b1da42a6aca9e35060fe82f17579ad111f0af
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)
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
- 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.
5
+ ## Developed by
6
6
 
7
- Check out this extension [multi vendor marketplace demo](https://spreecommerce.org/launch-a-multi-vendor-marketplace-within-a-few-weeks-with-spree-commerce/) and launch your marketplace within weeks, not months.
7
+ [![Vendo](https://assets-global.website-files.com/6230c485f2c32ea1b0daa438/623372f40a8c54ca9aea34e8_vendo%202.svg)](https://getvendo.com?utm_source=spree_multi_vendor_github)
8
8
 
9
- Developed and maintained by:
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
- [![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]
11
+ ## Open source vs Vendo
12
12
 
13
- ## Features
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
- By default you can create and manage Vendors who can manage on their own:
16
-
17
- - [X] Orders
18
- - [X] Products
19
- - [X] Stock Locations
20
- - [X] Shipping Methods
21
- - [X] Vendor profile
22
-
23
- Also:
24
- - [X] Super Admins can assign Users to Vendors
25
- - [X] You can modify which permissions and models/resources Vendors can manage quite easily
26
-
27
- Contributions welcome! :)
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,12 @@ 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 Spark Solutions
169
+ ## About Vendo
169
170
 
170
- [![Spark Solutions](http://sparksolutions.co/wp-content/uploads/2015/01/logo-ss-tr-221x100.png)][spark]
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**.
171
172
 
172
- Spree Vendors is maintained by [Spark Solutions Sp. z o.o.](http://sparksolutions.co?utm_source=github)
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.
173
174
 
174
- We are passionate about open source software.
175
- We are [available for hire][spark].
175
+ > [Get your free account](https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github)
176
176
 
177
- [spark]:http://sparksolutions.co?utm_source=github
177
+ [vendo]:https://app.getvendo.com/users/new?utm_source=spree_multi_vendor_github
@@ -1,7 +1,7 @@
1
1
  module Spree
2
2
  module Api
3
3
  module V1
4
- class VendorsController < Spree::Api::BaseController
4
+ class VendorsController < Spree::Api::V1::BaseController
5
5
  def index
6
6
  @vendors = if params[:ids].present?
7
7
  scope.where(id: params[:ids].split(','))
@@ -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?
@@ -16,4 +16,4 @@ module SpreeMultiVendor
16
16
  end
17
17
  end
18
18
 
19
- ::Spree::Api::ApiHelpers.prepend(SpreeMultiVendor::Spree::Api::ApiHelpersDecorator)
19
+ ::Spree::Api::ApiHelpers.prepend(SpreeMultiVendor::Spree::Api::ApiHelpersDecorator) if SpreeMultiVendor::Engine.api_v1_available?
@@ -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::Country.default).first_or_create!
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
@@ -3,21 +3,4 @@ Deface::Override.new(
3
3
  name: 'Display configuration tab for vendors',
4
4
  replace: 'erb[silent]:contains("current_store")',
5
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
- )
6
+ )
@@ -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, Spree.t(plural_resource_name(Spree::Vendor)) %>
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 %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :page_title do %>
2
- <%= Spree.t(plural_resource_name(Spree::Vendor)) %>
2
+ <%= plural_resource_name(Spree::Vendor) %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
@@ -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>
@@ -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
@@ -32,3 +32,4 @@ en:
32
32
  pending: Pending
33
33
  admin:
34
34
  commission: Commission
35
+ vendors: Vendors
@@ -34,3 +34,4 @@ es:
34
34
  pending: Pendiente
35
35
  admin:
36
36
  commission: Comisión
37
+ vendors: Vendedores
@@ -31,3 +31,4 @@ fr:
31
31
  pending: En attente
32
32
  admin:
33
33
  commission: Commission
34
+ vendors: Vendeurs
@@ -1,8 +1,14 @@
1
1
  class ChangeVendorIdAndUserIdTypeForSpreeVendorUsers < ActiveRecord::Migration[4.2]
2
- def change
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
@@ -1,8 +1,14 @@
1
1
  class ChangeVendorIdAndOrderIdTypeForSpreeOrderCommissions < ActiveRecord::Migration[4.2]
2
- def change
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
@@ -0,0 +1,27 @@
1
+ module SpreeMultiVendor
2
+ class Configuration
3
+ DEFAULT_VENDORIZED_MODELS ||= %w[product variant stock_location shipping_method].freeze
4
+
5
+ attr_accessor :vendorized_models
6
+
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
26
+ end
27
+ end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module SpreeMultiVendor
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.1'
3
3
 
4
4
  module_function
5
5
 
@@ -1,5 +1,6 @@
1
1
  require 'spree_core'
2
2
  require 'spree_backend'
3
+ require 'spree_emails'
3
4
  require 'spree_multi_vendor/engine'
4
5
  require 'spree_multi_vendor/version'
5
6
  require 'spree_extension'
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.3.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spark Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-07 00:00:00.000000000 Z
11
+ date: 2023-11-14 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.3.0
253
+ changelog_uri: https://github.com/spree-contrib/spree_multi_vendor/releases/tag/v2.4.1
254
254
  documentation_uri: https://guides.spreecommerce.org/
255
- source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.3.0
255
+ source_code_uri: https://github.com/spree-contrib/spree_multi_vendor/tree/v2.4.1
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.2.3
272
+ rubygems_version: 3.4.1
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: Spree Commerce multi vendor marketplace extension
@@ -1,10 +0,0 @@
1
- module SpreeMultiVendor
2
- class Configuration < ::Spree::Preferences::Configuration
3
- DEFAULT_VENDORIZED_MODELS ||= %w[product variant stock_location shipping_method].freeze
4
-
5
- # Some example preferences are shown below, for more information visit:
6
- # https://guides.spreecommerce.org/developer/core/preferences.html
7
-
8
- preference :vendorized_models, :array, default: DEFAULT_VENDORIZED_MODELS
9
- end
10
- end