spree_wholesale 0.40.0.beta2 → 0.40.0.beta2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/Rakefile +30 -0
- data/config/locales/en.yml +15 -0
- data/db/migrate/add_wholesale_price_to_variants.rb +9 -0
- data/db/migrate/add_wholesale_to_orders.rb +9 -0
- data/lib/spree_wholesale.rb +0 -3
- data/lib/tasks/install.rake +3 -0
- data/public/stylesheets/wholesale.css +10 -0
- metadata +8 -3
- data/lib/wholesale_products_helper.rb +0 -26
data/README.md
CHANGED
@@ -19,7 +19,7 @@ Install from the source:
|
|
19
19
|
Or install the (beta) gem:
|
20
20
|
|
21
21
|
gem install spree_wholesale --pre
|
22
|
-
echo "gem 'spree_wholesale', '0.40.0.
|
22
|
+
echo "gem 'spree_wholesale', '0.40.0.beta2'" >> Gemfile
|
23
23
|
|
24
24
|
rake spree_wholesale:install
|
25
25
|
rake db:migrate
|
@@ -32,7 +32,7 @@ If you want to generate sample wholesale prices:
|
|
32
32
|
This will assume 66% wholesale discount.
|
33
33
|
|
34
34
|
|
35
|
-
If you'd like run tests, install from the source,
|
35
|
+
If you'd like run tests, install from the source, then run:
|
36
36
|
|
37
37
|
cd your/spree/project/spree_wholesale
|
38
38
|
rake
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path('../../config/application', __FILE__)
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'rake/testtask'
|
6
|
+
require 'rake/packagetask'
|
7
|
+
require 'rake/gempackagetask'
|
8
|
+
|
9
|
+
|
10
|
+
spec = eval(File.read('spree_wholesale.gemspec'))
|
11
|
+
|
12
|
+
Rake::GemPackageTask.new(spec) do |p|
|
13
|
+
p.gem_spec = spec
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
desc "Test Spree Wholesale Extension"
|
18
|
+
task :test_extension do
|
19
|
+
require File.expand_path('../test/test_helper', __FILE__)
|
20
|
+
|
21
|
+
Dir["test/**/*.rb"].reject{|file| file.match(/test_helper/) != nil }.each do |file|
|
22
|
+
puts "Loading #{file}"
|
23
|
+
load file
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
desc "Default Task"
|
30
|
+
task :default => [ :test_extension ]
|
@@ -0,0 +1,15 @@
|
|
1
|
+
en:
|
2
|
+
wholesale: "Wholesale"
|
3
|
+
wholesale_customer: "Wholesale Customer ID: #%{id}"
|
4
|
+
|
5
|
+
admin:
|
6
|
+
hooks:
|
7
|
+
product_form_right:
|
8
|
+
master_wholesale_price: "Master Wholesale Price"
|
9
|
+
admin_orders_index_search:
|
10
|
+
show_wholesale_orders: "Show only wholesale orders"
|
11
|
+
|
12
|
+
variants:
|
13
|
+
form:
|
14
|
+
wholesale_price: "Wholesale Price"
|
15
|
+
|
data/lib/spree_wholesale.rb
CHANGED
@@ -15,9 +15,6 @@ module SpreeWholesale
|
|
15
15
|
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
16
16
|
Rails.env.production? ? require(c) : load(c)
|
17
17
|
end
|
18
|
-
|
19
|
-
Spree::Auth::Config.set :registration_step => false
|
20
|
-
|
21
18
|
end
|
22
19
|
|
23
20
|
config.to_prepare &method(:activate).to_proc
|
data/lib/tasks/install.rake
CHANGED
@@ -17,6 +17,9 @@ namespace :spree_wholesale do
|
|
17
17
|
|
18
18
|
source = File.expand_path('../../../db/migrate', __FILE__)
|
19
19
|
destination = File.join(Rails.root, 'db', 'migrate')
|
20
|
+
|
21
|
+
FileUtils.mkdir_p(destination)
|
22
|
+
|
20
23
|
migrations = Dir.entries(destination).select{|file| file.match('.rb') }
|
21
24
|
|
22
25
|
files = Dir.entries(source).select{|file| file.match('.rb') }
|
metadata
CHANGED
@@ -7,7 +7,8 @@ version: !ruby/object:Gem::Version
|
|
7
7
|
- 40
|
8
8
|
- 0
|
9
9
|
- beta2
|
10
|
-
|
10
|
+
- 3
|
11
|
+
version: 0.40.0.beta2.3
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Spencer Steffen
|
@@ -59,11 +60,11 @@ extra_rdoc_files: []
|
|
59
60
|
files:
|
60
61
|
- README.md
|
61
62
|
- LICENSE
|
63
|
+
- config/locales/en.yml
|
62
64
|
- lib/spree_wholesale.rb
|
63
65
|
- lib/spree_wholesale_hooks.rb
|
64
66
|
- lib/tasks/install.rake
|
65
67
|
- lib/tasks/spree_wholesale.rake
|
66
|
-
- lib/wholesale_products_helper.rb
|
67
68
|
- app/controllers/admin/orders_controller_decorator.rb
|
68
69
|
- app/models/line_item_decorator.rb
|
69
70
|
- app/models/order_decorator.rb
|
@@ -82,7 +83,11 @@ files:
|
|
82
83
|
- app/views/hooks/_wholesale_customer_id.html.erb
|
83
84
|
- app/views/orders/show.html.erb
|
84
85
|
- app/views/shared/_products.html.erb
|
85
|
-
|
86
|
+
- db/migrate/add_wholesale_price_to_variants.rb
|
87
|
+
- db/migrate/add_wholesale_to_orders.rb
|
88
|
+
- public/stylesheets/wholesale.css
|
89
|
+
- Rakefile
|
90
|
+
has_rdoc: false
|
86
91
|
homepage: http://github.com/citrus/spree_wholesale
|
87
92
|
licenses: []
|
88
93
|
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#module WholesaleProductsHelper
|
2
|
-
#
|
3
|
-
# # returns the price of the product to show for display purposes
|
4
|
-
# def product_price(product_or_variant, options={})
|
5
|
-
# options.assert_valid_keys(:format_as_currency, :show_vat_text)
|
6
|
-
# options.reverse_merge! :format_as_currency => true, :show_vat_text => Spree::Config[:show_price_inc_vat]
|
7
|
-
#
|
8
|
-
# puts "-----"
|
9
|
-
# puts current_user.roles.inspect
|
10
|
-
#
|
11
|
-
# if current_user.has_role?("wholesaler")
|
12
|
-
# _amount = product_or_variant.wholesale_price
|
13
|
-
# amount = _amount if 0.0 < _amount
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# amount ||= product_or_variant.price
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
# amount += Calculator::Vat.calculate_tax_on(product_or_variant) if Spree::Config[:show_price_inc_vat]
|
21
|
-
# options.delete(:format_as_currency) ? format_price(amount, options) : amount
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
#end
|
25
|
-
#
|
26
|
-
#ProductsHelper.send(:include, WholesaleProductsHelper)
|