solidus_marketplace 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/.rspec +1 -0
- data/.travis.yml +11 -0
- data/Gemfile +8 -0
- data/LICENSE +26 -0
- data/README.md +123 -0
- data/Rakefile +15 -0
- data/Versionfile +6 -0
- data/app/assets/javascripts/spree/backend/solidus_marketplace.js +5 -0
- data/app/assets/javascripts/spree/backend/solidus_marketplace_routes.js +1 -0
- data/app/assets/javascripts/spree/backend/suppliers_autocomplete.js +55 -0
- data/app/assets/javascripts/spree/frontend/solidus_marketplace.js +1 -0
- data/app/assets/stylesheets/spree/backend/solidus_marketplace.scss +22 -0
- data/app/assets/stylesheets/spree/frontend/solidus_marketplace.css +3 -0
- data/app/controllers/ckeditor/attachment_files_controller_decorator.rb +20 -0
- data/app/controllers/ckeditor/pictures_controller_decorator.rb +17 -0
- data/app/controllers/spree/admin/marketplace_settings_controller.rb +19 -0
- data/app/controllers/spree/admin/products_controller_decorator.rb +79 -0
- data/app/controllers/spree/admin/reports_controller_decorator.rb +68 -0
- data/app/controllers/spree/admin/shipments_controller.rb +47 -0
- data/app/controllers/spree/admin/stock_items_controller_decorator.rb +10 -0
- data/app/controllers/spree/admin/stock_locations_controller_decorator.rb +23 -0
- data/app/controllers/spree/admin/suppliers_controller.rb +54 -0
- data/app/controllers/spree/admin/users_controller_decorator.rb +34 -0
- data/app/controllers/spree/api/suppliers_controller.rb +16 -0
- data/app/controllers/spree/api/v1/stock_locations_controller_decorator.rb +18 -0
- data/app/controllers/spree/base_controller_decorator.rb +13 -0
- data/app/helpers/spree/api/api_helpers_decorator.rb +22 -0
- data/app/mailers/spree/marketplace_order_mailer.rb +13 -0
- data/app/mailers/spree/supplier_mailer.rb +12 -0
- data/app/models/ckeditor/asset_decorator.rb +5 -0
- data/app/models/spree.rb +5 -0
- data/app/models/spree/marketplace_configuration.rb +14 -0
- data/app/models/spree/order_decorator.rb +44 -0
- data/app/models/spree/payment_decorator.rb +7 -0
- data/app/models/spree/product_decorator.rb +52 -0
- data/app/models/spree/shipment_decorator.rb +40 -0
- data/app/models/spree/stock/splitter/marketplace.rb +47 -0
- data/app/models/spree/stock_location_decorator.rb +23 -0
- data/app/models/spree/supplier.rb +120 -0
- data/app/models/spree/supplier_ability.rb +35 -0
- data/app/models/spree/supplier_variant.rb +6 -0
- data/app/models/spree/user_decorator.rb +23 -0
- data/app/models/spree/variant_decorator.rb +24 -0
- data/app/overrides/spree/admin/menus.rb +15 -0
- data/app/overrides/spree/admin/products/_form/converted_admin_product_form_right.html.erb.deface +5 -0
- data/app/overrides/spree/admin/products/edit/override_rows.html.erb.deface +22 -0
- data/app/overrides/spree/admin/stock_locations/_form/add_supplier.html.erb.deface +12 -0
- data/app/views/spree/admin/marketplace_settings/edit.html.erb +21 -0
- data/app/views/spree/admin/orders/index.html.erb +187 -0
- data/app/views/spree/admin/products/_form.html.erb +198 -0
- data/app/views/spree/admin/reports/earnings.html.erb +34 -0
- data/app/views/spree/admin/shared/_marketplace_settings.html.erb +1 -0
- data/app/views/spree/admin/shared/_marketplace_tabs.html.erb +4 -0
- data/app/views/spree/admin/shipments/edit.html.erb +24 -0
- data/app/views/spree/admin/shipments/index.html.erb +93 -0
- data/app/views/spree/admin/suppliers/_form.html.erb +75 -0
- data/app/views/spree/admin/suppliers/edit.html.erb +22 -0
- data/app/views/spree/admin/suppliers/index.html.erb +68 -0
- data/app/views/spree/admin/suppliers/new.html.erb +17 -0
- data/app/views/spree/api/shared/_pagination.json.jbuilder +5 -0
- data/app/views/spree/api/suppliers/_supplier.json.jbuilder +1 -0
- data/app/views/spree/api/suppliers/index.json.jbuilder +4 -0
- data/app/views/spree/marketplace_order_mailer/supplier_order.html.erb +119 -0
- data/app/views/spree/shared/unauthorized.erb +1 -0
- data/app/views/spree/supplier_mailer/welcome.html.erb +53 -0
- data/config/locales/en.yml +107 -0
- data/config/locales/es.yml +133 -0
- data/config/routes.rb +24 -0
- data/db/default/spree/marketplace_roles.rb +14 -0
- data/db/migrate/20121006073854_create_suppliers.rb +20 -0
- data/db/migrate/20130216070944_product_belongs_to_supplier.rb +6 -0
- data/db/migrate/20130405005502_stock_locations_belongs_to_supplier.rb +6 -0
- data/db/migrate/20130405011127_user_belongs_to_supplier.rb +6 -0
- data/db/migrate/20130428063053_add_balanced_token_to_suppliers.rb +7 -0
- data/db/migrate/20130510181443_add_supplier_id_to_ckeditor_assets.rb +8 -0
- data/db/migrate/20130606220913_add_permalink_to_suppliers.rb +6 -0
- data/db/migrate/20140323170638_add_supplier_commission_to_shipments.rb +5 -0
- data/db/migrate/20140416184616_migrate_payment_and_commission.rb +7 -0
- data/db/migrate/20140529041325_create_spree_supplier_variants.rb +15 -0
- data/db/migrate/20171027180043_add_paypal_email_to_suppliers.rb +5 -0
- data/db/seeds.rb +8 -0
- data/lib/generators/solidus_marketplace/install/install_generator.rb +36 -0
- data/lib/solidus_marketplace.rb +6 -0
- data/lib/solidus_marketplace/engine.rb +53 -0
- data/lib/solidus_marketplace/factories.rb +107 -0
- data/lib/solidus_marketplace/version.rb +3 -0
- data/lib/spree/permitted_attributes_decorator.rb +18 -0
- data/lib/tasks/spree_sample.rake +72 -0
- data/log/awesome.log +1 -0
- data/script/rails +7 -0
- data/solidus_marketplace.gemspec +46 -0
- data/spec/features/admin/orders_spec.rb +11 -0
- data/spec/features/admin/products_spec.rb +25 -0
- data/spec/features/admin/return_authorizations_spec.rb +7 -0
- data/spec/features/admin/settings_spec.rb +33 -0
- data/spec/features/admin/shipments_spec.rb +80 -0
- data/spec/features/admin/stock_management_spec.rb +156 -0
- data/spec/features/admin/stock_spec.rb +98 -0
- data/spec/features/admin/suppliers_spec.rb +130 -0
- data/spec/models/spree/order_decorator_spec.rb +80 -0
- data/spec/models/spree/payment_decorator_spec.rb +7 -0
- data/spec/models/spree/product_decorator_spec.rb +56 -0
- data/spec/models/spree/shipment_decorator_spec.rb +48 -0
- data/spec/models/spree/stock/splitter/marketplace_spec.rb +62 -0
- data/spec/models/spree/stock_location_decorator_spec.rb +33 -0
- data/spec/models/spree/supplier_ability_spec.rb +182 -0
- data/spec/models/spree/supplier_spec.rb +123 -0
- data/spec/models/spree/supplier_variant_spec.rb +5 -0
- data/spec/models/spree/user_decorator_spec.rb +57 -0
- data/spec/models/spree/variant_decorator_spec.rb +7 -0
- data/spec/spec_helper.rb +91 -0
- data/spec/support/ability_helpers.rb +11 -0
- data/spec/support/integration_helpers.rb +15 -0
- metadata +473 -0
data/config/routes.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
Spree::Core::Engine.routes.draw do
|
2
|
+
|
3
|
+
namespace :admin do
|
4
|
+
resource :marketplace_settings
|
5
|
+
resources :shipments
|
6
|
+
resources :suppliers
|
7
|
+
end
|
8
|
+
|
9
|
+
namespace :api do
|
10
|
+
resources :suppliers, only: :index
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
Spree::Core::Engine.routes.prepend do
|
16
|
+
namespace :admin do
|
17
|
+
resources :reports do
|
18
|
+
collection do
|
19
|
+
get :earnings
|
20
|
+
post :earnings
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# create supplier_admin role, new supplier and supplier_admin user
|
2
|
+
supplier_admin_role = Spree::Role.where(name: "supplier_admin").first_or_create
|
3
|
+
new_supplier = Spree::Supplier.new(name: "Kevin's Guitars", email: "kevinsguitars@example.com")
|
4
|
+
supplier_admin = Spree::User.create(email: "supplier_admin@example.com",
|
5
|
+
password: "test123",
|
6
|
+
password_confirmation: "test123",
|
7
|
+
supplier: new_supplier)
|
8
|
+
supplier_admin.spree_roles << supplier_admin_role
|
9
|
+
|
10
|
+
# create marketmaker user
|
11
|
+
admin_role = Spree::Role.find_by(name: "admin")
|
12
|
+
marketmaker = Spree::User.create(email: "marketmaker@example.com", password: "test123", password_confirmation: "test123")
|
13
|
+
marketmaker.spree_roles << admin_role
|
14
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateSuppliers < ActiveRecord::Migration[4.2]
|
2
|
+
|
3
|
+
def change
|
4
|
+
create_table :spree_suppliers do |t|
|
5
|
+
t.boolean :active, default: false, null: false
|
6
|
+
t.references :address
|
7
|
+
t.decimal :commission_flat_rate, :precision => 8, :scale => 2, :default => 0.0, :null => false
|
8
|
+
t.float :commission_percentage, default: 0.0, null: false
|
9
|
+
t.string :email
|
10
|
+
t.string :name
|
11
|
+
t.string :url
|
12
|
+
t.datetime :deleted_at
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
add_index :spree_suppliers, :address_id
|
16
|
+
add_index :spree_suppliers, :deleted_at
|
17
|
+
add_index :spree_suppliers, :active
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateSpreeSupplierVariants < ActiveRecord::Migration[4.2]
|
2
|
+
def change
|
3
|
+
create_table :spree_supplier_variants do |t|
|
4
|
+
t.belongs_to :supplier, index: true
|
5
|
+
t.belongs_to :variant, index: true
|
6
|
+
t.decimal :cost
|
7
|
+
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
Spree::Product.where.not(supplier_id: nil).each do |product|
|
11
|
+
product.add_supplier! product.supplier_id
|
12
|
+
end
|
13
|
+
remove_column :spree_products, :supplier_id
|
14
|
+
end
|
15
|
+
end
|
data/db/seeds.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module SolidusMarketplace
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
class_option :auto_run_migrations, :type => :boolean, :default => false
|
5
|
+
|
6
|
+
def add_javascripts
|
7
|
+
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_marketplace\n"
|
8
|
+
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/solidus_marketplace\n"
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_stylesheets
|
12
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_marketplace\n", :before => /\*\//, :verbose => true
|
13
|
+
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/solidus_marketplace\n", :before => /\*\//, :verbose => true
|
14
|
+
end
|
15
|
+
|
16
|
+
def include_seed_data
|
17
|
+
seed_file = "db/seeds.rb"
|
18
|
+
content = "SolidusMarketplace::Engine.load_seed if defined?(SolidusMarketplace)"
|
19
|
+
append_file(seed_file, content) unless File.readlines(seed_file).last == content
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_migrations
|
23
|
+
run 'bundle exec rake railties:install:migrations FROM=solidus_marketplace'
|
24
|
+
end
|
25
|
+
|
26
|
+
def run_migrations
|
27
|
+
run_migrations = options[:auto_run_migrations] || ENV['AUTO_RUN_MIGRATIONS'] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
|
28
|
+
if run_migrations
|
29
|
+
run 'bundle exec rake db:migrate'
|
30
|
+
else
|
31
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module SolidusMarketplace
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'solidus_marketplace'
|
6
|
+
|
7
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
8
|
+
|
9
|
+
# use rspec for tests
|
10
|
+
config.generators do |g|
|
11
|
+
g.test_framework :rspec
|
12
|
+
end
|
13
|
+
|
14
|
+
initializer 'solidus_marketplace.custom_splitters', after: 'spree.register.stock_splitters' do |app|
|
15
|
+
app.config.spree.stock_splitters << Spree::Stock::Splitter::Marketplace
|
16
|
+
end
|
17
|
+
|
18
|
+
initializer "solidus_marketplace.preferences", before: :load_config_initializers do |app|
|
19
|
+
SolidusMarketplace::Config = Spree::MarketplaceConfiguration.new
|
20
|
+
end
|
21
|
+
|
22
|
+
initializer "solidus_marketplace.menu", before: :load_config_initializers do |app|
|
23
|
+
Spree::Backend::Config.configure do |config|
|
24
|
+
config.menu_items << Spree::BackendConfiguration::MenuItem.new(
|
25
|
+
[:stock_locations],
|
26
|
+
'globe',
|
27
|
+
condition: -> { can?(:index, Spree::StockLocation) },
|
28
|
+
)
|
29
|
+
|
30
|
+
config.menu_items << Spree::BackendConfiguration::MenuItem.new(
|
31
|
+
[:suppliers],
|
32
|
+
'home',
|
33
|
+
condition: -> { can?(:index, Spree::Supplier) },
|
34
|
+
)
|
35
|
+
|
36
|
+
config.menu_items << Spree::BackendConfiguration::MenuItem.new(
|
37
|
+
[:shipments],
|
38
|
+
'plane',
|
39
|
+
condition: -> { can?(:index, Spree::Shipment) },
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.activate
|
45
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
46
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
47
|
+
end
|
48
|
+
Spree::Ability.register_ability(Spree::SupplierAbility)
|
49
|
+
end
|
50
|
+
|
51
|
+
config.to_prepare &method(:activate).to_proc
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
|
3
|
+
factory :order_from_supplier, parent: :order do
|
4
|
+
bill_address
|
5
|
+
ship_address
|
6
|
+
|
7
|
+
transient do
|
8
|
+
line_items_count 5
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:create) do |order, evaluator|
|
12
|
+
supplier = create(:supplier)
|
13
|
+
product = create(:product)
|
14
|
+
product.add_supplier! supplier
|
15
|
+
# product.stock_items.where(variant_id: product.master.id).first.adjust_count_on_hand(10)
|
16
|
+
|
17
|
+
product_2 = create(:product)
|
18
|
+
product_2.add_supplier! create(:supplier)
|
19
|
+
|
20
|
+
create_list(:line_item, evaluator.line_items_count,
|
21
|
+
order: order,
|
22
|
+
variant: product_2.master
|
23
|
+
)
|
24
|
+
order.line_items.reload
|
25
|
+
|
26
|
+
create(:shipment, order: order, stock_location: supplier.stock_locations.first)
|
27
|
+
order.shipments.reload
|
28
|
+
|
29
|
+
order.recalculate
|
30
|
+
end
|
31
|
+
|
32
|
+
factory :completed_order_from_supplier_with_totals do
|
33
|
+
state 'complete'
|
34
|
+
|
35
|
+
after(:create) do |order|
|
36
|
+
order.refresh_shipment_rates
|
37
|
+
order.update_column(:completed_at, Time.now)
|
38
|
+
end
|
39
|
+
|
40
|
+
factory :order_from_supplier_ready_to_ship do
|
41
|
+
payment_state 'paid'
|
42
|
+
shipment_state 'ready'
|
43
|
+
|
44
|
+
after(:create) do |order|
|
45
|
+
create(:payment, amount: order.total, order: order, state: 'completed')
|
46
|
+
order.shipments.each do |shipment|
|
47
|
+
shipment.inventory_units.each { |u| u.update_column('state', 'on_hand') }
|
48
|
+
shipment.update_column('state', 'ready')
|
49
|
+
end
|
50
|
+
order.reload
|
51
|
+
end
|
52
|
+
|
53
|
+
factory :shipped_order_from_supplier do
|
54
|
+
after(:create) do |order|
|
55
|
+
order.shipments.each do |shipment|
|
56
|
+
shipment.inventory_units.each { |u| u.update_column('state', 'shipped') }
|
57
|
+
shipment.update_column('state', 'shipped')
|
58
|
+
end
|
59
|
+
order.reload
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
factory :supplier, :class => Spree::Supplier do
|
67
|
+
sequence(:name) { |i| "Big Store #{i}" }
|
68
|
+
email { FFaker::Internet.email }
|
69
|
+
url "http://example.com"
|
70
|
+
address
|
71
|
+
commission_flat_rate 0.0
|
72
|
+
commission_percentage 10.0
|
73
|
+
# Creating a stock location with a factory instead of letting the model handle it
|
74
|
+
# so that we can run tests with backorderable defaulting to true.
|
75
|
+
before :create do |supplier|
|
76
|
+
supplier.stock_locations << build(:stock_location, name: supplier.name, supplier: supplier)
|
77
|
+
end
|
78
|
+
|
79
|
+
factory :supplier_with_commission do
|
80
|
+
commission_flat_rate 0.5
|
81
|
+
commission_percentage 10
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
factory :supplier_user, parent: :user do
|
86
|
+
supplier
|
87
|
+
end
|
88
|
+
|
89
|
+
factory :supplier_admin_role, parent: :role do
|
90
|
+
name "supplier_admin"
|
91
|
+
end
|
92
|
+
|
93
|
+
factory :supplier_admin, parent: :user do
|
94
|
+
supplier
|
95
|
+
|
96
|
+
after :create do |user|
|
97
|
+
user.spree_roles << create(:supplier_admin_role)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
factory :variant_with_supplier, parent: :variant do
|
102
|
+
after :create do |variant|
|
103
|
+
variant.product.add_supplier! create(:supplier)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Spree::PermittedAttributes.class_eval do
|
2
|
+
@@supplier_attributes = [
|
3
|
+
:id,
|
4
|
+
:address_id,
|
5
|
+
:commission_flat_rate,
|
6
|
+
:commission_percentage,
|
7
|
+
:email,
|
8
|
+
:name,
|
9
|
+
:url,
|
10
|
+
:deleted_at,
|
11
|
+
:tax_id,
|
12
|
+
:token,
|
13
|
+
:slug,
|
14
|
+
:paypal_email
|
15
|
+
]
|
16
|
+
|
17
|
+
mattr_reader(:supplier_attributes)
|
18
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
namespace :spree_sample do
|
2
|
+
desc "Create sample marketplace orders"
|
3
|
+
task :marketplace_orders => :environment do
|
4
|
+
if Spree::Order.count == 0
|
5
|
+
puts "Please run `rake spree_sample:load` first to create products and orders"
|
6
|
+
exit
|
7
|
+
end
|
8
|
+
|
9
|
+
if Spree::Supplier.count == 0
|
10
|
+
puts "Please run `rake spree_sample:suppliers` first to create suppliers"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
|
14
|
+
count = 0
|
15
|
+
@orders = Spree::Order.complete.includes(:line_items).all
|
16
|
+
@suppliers = Spree::Supplier.all
|
17
|
+
|
18
|
+
puts "Linking existing line items to suppliers"
|
19
|
+
Spree::LineItem.all.each do |li|
|
20
|
+
print "*" if li.product.add_supplier! @suppliers.shuffle.first.id and li.save
|
21
|
+
end
|
22
|
+
puts
|
23
|
+
|
24
|
+
puts "Creating marketplace orders for existing orders"
|
25
|
+
Spree::Order.all.each do |order|
|
26
|
+
print "*" if order.finalize!
|
27
|
+
end
|
28
|
+
puts
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "Create sample suppliers and randomly link to products"
|
32
|
+
task :suppliers => :environment do
|
33
|
+
old_send_value = SolidusMarketplace::Config[:send_supplier_email]
|
34
|
+
SolidusMarketplace::Config[:send_supplier_email] = false
|
35
|
+
|
36
|
+
@usa = Spree::Country.find_by_iso("US")
|
37
|
+
@ca = @usa.states.find_by_abbr("CA")
|
38
|
+
|
39
|
+
count = Spree::Supplier.count
|
40
|
+
puts "Creating Suppliers..."
|
41
|
+
5.times{|i|
|
42
|
+
name = "Supplier #{count + i + 1}"
|
43
|
+
supplier = Spree::Supplier.new(:name => name,
|
44
|
+
:email => "#{name.parameterize}@example.com",
|
45
|
+
:url => "http://example.com")
|
46
|
+
supplier.build_address(:firstname => name, :lastname => name,
|
47
|
+
:address1 => "100 State St",
|
48
|
+
:city => "Santa Barbara", :zipcode => "93101",
|
49
|
+
:state_id => @ca.id, :country_id => @usa.id,
|
50
|
+
:phone => '1234567890')
|
51
|
+
print "*" if supplier.save
|
52
|
+
}
|
53
|
+
puts
|
54
|
+
puts "#{Spree::Supplier.count - count} suppliers created"
|
55
|
+
|
56
|
+
puts "Randomly linking Products & Suppliers..."
|
57
|
+
|
58
|
+
@supplier_ids = Spree::Supplier.pluck(:id).shuffle
|
59
|
+
@products = Spree::Product.all
|
60
|
+
count = 0
|
61
|
+
|
62
|
+
@products.each do |product|
|
63
|
+
product.add_supplier! Spree::Supplier.find(@supplier_ids[rand(@supplier_ids.length)])
|
64
|
+
product.save
|
65
|
+
count += 1
|
66
|
+
print "*"
|
67
|
+
end
|
68
|
+
puts
|
69
|
+
puts "#{count} products linked."
|
70
|
+
SolidusMarketplace::Config[:send_supplier_email] = old_send_value
|
71
|
+
end
|
72
|
+
end
|