solidus_legacy_promotions 4.4.0 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/solidus_legacy_promotions/promotions.scss +1 -1
- data/app/decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb +5 -0
- data/app/models/spree/line_item_action.rb +8 -0
- data/config/locales/en.yml +6 -2
- data/db/migrate/20160101010001_solidus_one_four_promotions.rb +12 -0
- data/lib/components/admin/solidus_legacy_promotions/orders/index/component.yml +0 -15
- data/lib/solidus_legacy_promotions/engine.rb +21 -7
- data/solidus_legacy_promotions.gemspec +1 -1
- metadata +7 -7
- data/bin/rails +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7e25a87b32de8febdd67d28fa5a558d26c5128875d06b637b8ed52bfa0a2dc9
|
4
|
+
data.tar.gz: 98d7ff2153ecc29358483226092aa7001aa4f1e4e3a64ed0db8d97c662ad9786
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f71034d931089916518921d45a125ec90a345d1db2fe1579eabfb0fe39afa3e0ec55c6d548929a7b25ac48359a3b8330b5cb87e90293e98d63c567b3ec5ed649
|
7
|
+
data.tar.gz: 690f0d2397d6fbe4d1bc144aef2b4f8f49fc7a7ea061be32b249452f30b7ca72c6382c91f8a882960887d16f9b0da2bbe82160855210b9f0cc2035fe3b2e83fc
|
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
module SolidusLegacyPromotions
|
4
4
|
module SpreeLineItemDecorator
|
5
|
+
def self.prepended(base)
|
6
|
+
base.has_many :line_item_actions, dependent: :destroy
|
7
|
+
base.has_many :actions, through: :line_item_actions
|
8
|
+
end
|
9
|
+
|
5
10
|
def total_before_tax
|
6
11
|
amount + adjustments.select { |value| !value.tax? && value.eligible? }.sum(&:amount)
|
7
12
|
end
|
data/config/locales/en.yml
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
en:
|
2
|
+
solidus_admin:
|
3
|
+
menu_item:
|
4
|
+
legacy_promotions: Promotions
|
5
|
+
legacy_promotion_categories: Promotion Categories
|
2
6
|
spree:
|
3
7
|
admin:
|
4
8
|
promotion_status:
|
@@ -23,8 +27,8 @@ en:
|
|
23
27
|
general: General
|
24
28
|
starts_at_placeholder: Immediately
|
25
29
|
tab:
|
26
|
-
|
27
|
-
|
30
|
+
legacy_promotions: Promotions
|
31
|
+
legacy_promotion_categories: Promotion Categories
|
28
32
|
back_to_promotion_categories_list: Back To Promotions Categories List
|
29
33
|
back_to_promotions_list: Back To Promotions List
|
30
34
|
base_amount: Base Amount
|
@@ -122,5 +122,17 @@ class SolidusOneFourPromotions < ActiveRecord::Migration[5.0]
|
|
122
122
|
t.index ["starts_at"], name: "index_spree_promotions_on_starts_at"
|
123
123
|
end
|
124
124
|
end
|
125
|
+
|
126
|
+
unless table_exists?(:spree_line_item_actions)
|
127
|
+
create_table "spree_line_item_actions", force: :cascade do |t|
|
128
|
+
t.integer "line_item_id", null: false
|
129
|
+
t.integer "action_id", null: false
|
130
|
+
t.integer "quantity", default: 0
|
131
|
+
t.datetime "created_at", precision: 6
|
132
|
+
t.datetime "updated_at", precision: 6
|
133
|
+
t.index ["action_id"], name: "index_spree_line_item_actions_on_action_id"
|
134
|
+
t.index ["line_item_id"], name: "index_spree_line_item_actions_on_line_item_id"
|
135
|
+
end
|
136
|
+
end
|
125
137
|
end
|
126
138
|
end
|
@@ -1,20 +1,5 @@
|
|
1
1
|
en:
|
2
|
-
columns:
|
3
|
-
items:
|
4
|
-
one: 1 Item
|
5
|
-
other: '%{count} Items'
|
6
2
|
filters:
|
7
|
-
status: Status
|
8
|
-
shipment_state: Shipment State
|
9
|
-
payment_state: Payment State
|
10
3
|
promotions: Promotions
|
11
|
-
date:
|
12
|
-
formats:
|
13
|
-
short: '%d %b %y'
|
14
4
|
scopes:
|
15
|
-
all_orders: All
|
16
|
-
canceled: Canceled
|
17
|
-
complete: Complete
|
18
|
-
returned: Returned
|
19
|
-
in_progress: In Progress
|
20
5
|
promotions: Promotions
|
@@ -9,7 +9,7 @@ module SolidusLegacyPromotions
|
|
9
9
|
initializer "solidus_legacy_promotions.add_backend_menu_item" do
|
10
10
|
if SolidusSupport.backend_available?
|
11
11
|
promotions_menu_item = Spree::BackendConfiguration::MenuItem.new(
|
12
|
-
label: :
|
12
|
+
label: :legacy_promotions,
|
13
13
|
icon: Spree::Backend::Config.admin_updated_navbar ? "ri-megaphone-line" : "bullhorn",
|
14
14
|
partial: "spree/admin/shared/promotion_sub_menu",
|
15
15
|
condition: -> { can?(:admin, Spree::Promotion) },
|
@@ -17,12 +17,14 @@ module SolidusLegacyPromotions
|
|
17
17
|
data_hook: :admin_promotion_sub_tabs,
|
18
18
|
children: [
|
19
19
|
Spree::BackendConfiguration::MenuItem.new(
|
20
|
-
label: :
|
21
|
-
condition: -> { can?(:admin, Spree::Promotion) }
|
20
|
+
label: :legacy_promotions,
|
21
|
+
condition: -> { can?(:admin, Spree::Promotion) },
|
22
|
+
url: :admin_promotions_path
|
22
23
|
),
|
23
24
|
Spree::BackendConfiguration::MenuItem.new(
|
24
|
-
label: :
|
25
|
-
condition: -> { can?(:admin, Spree::PromotionCategory) }
|
25
|
+
label: :legacy_promotion_categories,
|
26
|
+
condition: -> { can?(:admin, Spree::PromotionCategory) },
|
27
|
+
url: -> { Spree::Core::Engine.routes.url_helpers.admin_promotion_categories_path },
|
26
28
|
)
|
27
29
|
]
|
28
30
|
)
|
@@ -41,10 +43,22 @@ module SolidusLegacyPromotions
|
|
41
43
|
if SolidusSupport.admin_available?
|
42
44
|
SolidusAdmin::Config.configure do |config|
|
43
45
|
config.menu_items << {
|
44
|
-
key: "
|
46
|
+
key: "legacy_promotions",
|
45
47
|
route: -> { spree.admin_promotions_path },
|
46
48
|
icon: "megaphone-line",
|
47
|
-
position:
|
49
|
+
position: 1.5,
|
50
|
+
children: [
|
51
|
+
{
|
52
|
+
key: "legacy_promotions",
|
53
|
+
route: -> { spree.admin_promotions_path },
|
54
|
+
position: 1
|
55
|
+
},
|
56
|
+
{
|
57
|
+
key: "legacy_promotion_categories",
|
58
|
+
route: -> { spree.admin_promotion_categories_path },
|
59
|
+
position: 2
|
60
|
+
}
|
61
|
+
]
|
48
62
|
}
|
49
63
|
end
|
50
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_legacy_promotions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.4.
|
4
|
+
version: 4.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.4.
|
19
|
+
version: 4.4.1
|
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.4.
|
26
|
+
version: 4.4.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.4.
|
33
|
+
version: 4.4.1
|
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.4.
|
40
|
+
version: 4.4.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: solidus_support
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- app/models/spree/calculator/percent_on_line_item.rb
|
95
95
|
- app/models/spree/calculator/tiered_flat_rate.rb
|
96
96
|
- app/models/spree/calculator/tiered_percent.rb
|
97
|
+
- app/models/spree/line_item_action.rb
|
97
98
|
- app/models/spree/order_contents.rb
|
98
99
|
- app/models/spree/order_promotion.rb
|
99
100
|
- app/models/spree/permission_sets/promotion_display.rb
|
@@ -140,7 +141,6 @@ files:
|
|
140
141
|
- app/views/spree/order_mailer/confirm_email.text.erb
|
141
142
|
- app/views/spree/promotion_code_batch_mailer/promotion_code_batch_errored.text.erb
|
142
143
|
- app/views/spree/promotion_code_batch_mailer/promotion_code_batch_finished.text.erb
|
143
|
-
- bin/rails
|
144
144
|
- config/locales/en.yml
|
145
145
|
- config/locales/promotion_categories.en.yml
|
146
146
|
- config/locales/promotions.en.yml
|
data/bin/rails
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
-
# installed from the root of your application.
|
4
|
-
|
5
|
-
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
-
ENGINE_PATH = File.expand_path('../lib/solidus_legacy_promotions/engine', __dir__)
|
7
|
-
|
8
|
-
# Set up gems listed in the Gemfile.
|
9
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
|
10
|
-
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
11
|
-
|
12
|
-
require "rails/all"
|
13
|
-
require "rails/engine/commands"
|