Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Adds ability to multi-vendorize the app (#11579)

Damian Legawiec2bda793d1155
diff --git a/core/app/models/spree/order.rb b/core/app/models/spree/order.rb
index ed47aee22d..7681fee311 100644
--- a/core/app/models/spree/order.rb
+++ b/core/app/models/spree/order.rb
@@ -31,6 +31,9 @@ module Spree
if defined?(Spree::Security::Orders)
include Spree::Security::Orders
end
+ if defined?(Spree::VendorConcern)
+ include Spree::VendorConcern
+ end
MEMOIZED_METHODS = %w(tax_zone)
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rb
index be5087f7d2..853e731f97 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -28,6 +28,9 @@ module Spree
if defined?(Spree::Webhooks)
include Spree::Webhooks::HasWebhooks
end
+ if defined?(Spree::VendorConcern)
+ include Spree::VendorConcern
+ end
MEMOIZED_METHODS = %w(total_on_hand taxonomy_ids taxon_and_ancestors category
default_variant_id tax_category default_variant
diff --git a/core/app/models/spree/shipping_method.rb b/core/app/models/spree/shipping_method.rb
index 51a79ddca9..74f5dacc28 100644
--- a/core/app/models/spree/shipping_method.rb
+++ b/core/app/models/spree/shipping_method.rb
@@ -6,6 +6,9 @@ module Spree
if defined?(Spree::Webhooks)
include Spree::Webhooks::HasWebhooks
end
+ if defined?(Spree::VendorConcern)
+ include Spree::VendorConcern
+ end
DISPLAY = [:both, :front_end, :back_end]
diff --git a/core/app/models/spree/stock_location.rb b/core/app/models/spree/stock_location.rb
index 95c890f5eb..4113c7b885 100644
--- a/core/app/models/spree/stock_location.rb
+++ b/core/app/models/spree/stock_location.rb
@@ -7,6 +7,9 @@ module Spree
if defined?(Spree::Security::StockLocations)
include Spree::Security::StockLocations
end
+ if defined?(Spree::VendorConcern)
+ include Spree::VendorConcern
+ end
has_many :shipments
has_many :stock_items, dependent: :delete_all, inverse_of: :stock_location