spree_core 4.1.0.rc2 → 4.1.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/spree/products_helper.rb +3 -3
- data/app/models/spree/inventory_unit.rb +2 -2
- data/app/models/spree/taxon.rb +1 -0
- data/app/presenters/spree/variants/option_types_presenter.rb +5 -4
- data/config/locales/en.yml +5 -3
- data/db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb +5 -0
- data/lib/generators/spree/install/templates/config/spree_storefront.yml +6 -6
- data/lib/spree/core/search/base.rb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/permitted_attributes.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7062a9bb28afea833ef56e653f7f974eaf33f6d10c352c407beea07910ed2b7e
|
4
|
+
data.tar.gz: 0effc4f253609ec14cd29109e21161b44cb92af1c1a53840f24bd27dae5fd0d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5024b7281e7cfa97efbb104d6f243d9783d36288d5dfe8e91a8ebe14a52e04bc61f78e7cf8a3765224d8a9a7ea4e18d218b0e9d924c12b111a629544ed36ddf9
|
7
|
+
data.tar.gz: dc6c98bf3679d2997e966f1efc671d87523fb994650fdff5968ed2c52523171a60c9b406f93c645bb34a52a1c5fbfc9215d1f574bc52a955082f54fba255cb3c
|
@@ -127,8 +127,8 @@ module Spree
|
|
127
127
|
limit(Spree::Config[:products_per_page])
|
128
128
|
end
|
129
129
|
|
130
|
-
def product_available_in_currency?
|
131
|
-
!(
|
130
|
+
def product_available_in_currency?
|
131
|
+
!(@product_price.nil? || @product_price.zero?)
|
132
132
|
end
|
133
133
|
|
134
134
|
def common_product_cache_keys
|
@@ -147,7 +147,7 @@ module Spree
|
|
147
147
|
@_variants_option_types_presenter ||= begin
|
148
148
|
option_types = Spree::Variants::OptionTypesFinder.new(variant_ids: variants.map(&:id)).execute
|
149
149
|
|
150
|
-
Spree::Variants::OptionTypesPresenter.new(option_types)
|
150
|
+
Spree::Variants::OptionTypesPresenter.new(option_types, variants)
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
@@ -4,11 +4,11 @@ module Spree
|
|
4
4
|
belongs_to :variant, class_name: 'Spree::Variant'
|
5
5
|
belongs_to :order, class_name: 'Spree::Order'
|
6
6
|
belongs_to :shipment, class_name: 'Spree::Shipment', touch: true, optional: true
|
7
|
-
|
7
|
+
has_many :return_items
|
8
|
+
has_many :return_authorizations, class_name: 'Spree::ReturnAuthorization', through: :return_items
|
8
9
|
belongs_to :line_item, class_name: 'Spree::LineItem'
|
9
10
|
end
|
10
11
|
|
11
|
-
has_many :return_items, inverse_of: :inventory_unit
|
12
12
|
belongs_to :original_return_item, class_name: 'Spree::ReturnItem'
|
13
13
|
|
14
14
|
scope :backordered, -> { where state: 'backordered' }
|
data/app/models/spree/taxon.rb
CHANGED
@@ -21,6 +21,7 @@ module Spree
|
|
21
21
|
|
22
22
|
validates :name, presence: true, uniqueness: { scope: [:parent_id, :taxonomy_id], allow_blank: true, case_sensitive: false }
|
23
23
|
validates :permalink, uniqueness: { case_sensitive: false }
|
24
|
+
validates :hide_from_nav, inclusion: { in: [true, false] }
|
24
25
|
validates_associated :icon
|
25
26
|
validate :check_for_root, on: :create
|
26
27
|
with_options length: { maximum: 255 }, allow_blank: true do
|
@@ -1,8 +1,9 @@
|
|
1
1
|
module Spree
|
2
2
|
module Variants
|
3
3
|
class OptionTypesPresenter
|
4
|
-
def initialize(option_types)
|
4
|
+
def initialize(option_types, variants)
|
5
5
|
@option_types = option_types
|
6
|
+
@variant_ids = variants.map(&:id)
|
6
7
|
end
|
7
8
|
|
8
9
|
def default_variant
|
@@ -43,7 +44,7 @@ module Spree
|
|
43
44
|
|
44
45
|
def find_variant_data(&block)
|
45
46
|
option_types.first.option_values.each do |option_value|
|
46
|
-
variant = option_value.variants.find(&block)
|
47
|
+
variant = option_value.variants.where(id: @variant_ids).find(&block)
|
47
48
|
|
48
49
|
return { variant: variant, option_value: option_value } if variant
|
49
50
|
end
|
@@ -53,7 +54,7 @@ module Spree
|
|
53
54
|
|
54
55
|
def find_first_variant_data
|
55
56
|
option_value = option_types.first.option_values.first
|
56
|
-
variant = option_value.variants.first
|
57
|
+
variant = option_value.variants.where(id: @variant_ids).first
|
57
58
|
|
58
59
|
{ variant: variant, option_value: option_value }
|
59
60
|
end
|
@@ -64,7 +65,7 @@ module Spree
|
|
64
65
|
id: option_value.id,
|
65
66
|
position: option_value.position,
|
66
67
|
presentation: option_value.presentation,
|
67
|
-
variant_id: option_value.variants.first.id,
|
68
|
+
variant_id: option_value.variants.where(id: @variant_ids).first.id,
|
68
69
|
is_default: option_value == default_variant_data[:option_value]
|
69
70
|
}
|
70
71
|
end
|
data/config/locales/en.yml
CHANGED
@@ -635,7 +635,7 @@ en:
|
|
635
635
|
cart_page:
|
636
636
|
add_promo_code: ADD PROMO CODE
|
637
637
|
checkout: checkout
|
638
|
-
empty_info: 'Your cart is empty
|
638
|
+
empty_info: 'Your cart is empty.'
|
639
639
|
header: Your shopping bag
|
640
640
|
product: product
|
641
641
|
quantity: quantity
|
@@ -767,7 +767,7 @@ en:
|
|
767
767
|
dismiss_banner: No. Thanks! I'm not interested, do not display this message again
|
768
768
|
display: Display
|
769
769
|
doesnt_track_inventory: It doesn't track inventory
|
770
|
-
dont_have_account:
|
770
|
+
dont_have_account: No account?
|
771
771
|
edit: Edit
|
772
772
|
editing_resource: 'Editing %{resource}'
|
773
773
|
editing_rma_reason: Editing RMA Reason
|
@@ -864,6 +864,7 @@ en:
|
|
864
864
|
guest_user_account: Checkout as a Guest
|
865
865
|
has_no_shipped_units: has no shipped units
|
866
866
|
height: Height
|
867
|
+
hide_from_subcategories_nav: Hide from subcategories navigation
|
867
868
|
home: Home
|
868
869
|
homepage:
|
869
870
|
bestsellers: BESTSELLERS
|
@@ -1212,7 +1213,7 @@ en:
|
|
1212
1213
|
not_found_filters2: Please try another choose.
|
1213
1214
|
not_found_text1: We couldn’t find products for '%{keywords}'.
|
1214
1215
|
not_found_text2: Please try another search.
|
1215
|
-
price:
|
1216
|
+
price: Price
|
1216
1217
|
price_high_to_low: PRICE (HIGH - LOW)
|
1217
1218
|
price_low_to_high: PRICE (LOW - HIGH)
|
1218
1219
|
result: RESULT
|
@@ -1350,6 +1351,7 @@ en:
|
|
1350
1351
|
rename: Rename
|
1351
1352
|
report: Report
|
1352
1353
|
reports: Reports
|
1354
|
+
required: '*'
|
1353
1355
|
required_fields: required fields
|
1354
1356
|
resellable: Resellable
|
1355
1357
|
resend: Resend
|
@@ -19,11 +19,11 @@ default:
|
|
19
19
|
promo_banners:
|
20
20
|
- subtitle: New collection
|
21
21
|
title: Summer 2019
|
22
|
-
url: /t/summer-
|
22
|
+
url: /t/new-collection/summer-2019
|
23
23
|
image: 'meganav/promo_banner_left-first-category.jpg'
|
24
24
|
- subtitle: Special Offers
|
25
25
|
title: Get up to 30% off
|
26
|
-
url: /t/special-offers
|
26
|
+
url: /t/special-offers/30-off
|
27
27
|
image: 'meganav/promo_banner_right-first-category.jpg'
|
28
28
|
- title: Men
|
29
29
|
subtitle: Categories
|
@@ -40,11 +40,11 @@ default:
|
|
40
40
|
promo_banners:
|
41
41
|
- subtitle: New collection
|
42
42
|
title: Summer 2019
|
43
|
-
url: /t/summer-
|
43
|
+
url: /t/new-collection/summer-2019
|
44
44
|
image: 'meganav/promo_banner_left-second-category.jpg'
|
45
45
|
- subtitle: Special Offers
|
46
46
|
title: Get up to 30% off
|
47
|
-
url: /t/special-offers
|
47
|
+
url: /t/special-offers/30-off
|
48
48
|
image: 'meganav/promo_banner_right-second-category.jpg'
|
49
49
|
- title: Sportswear
|
50
50
|
subtitle: Categories
|
@@ -59,9 +59,9 @@ default:
|
|
59
59
|
promo_banners:
|
60
60
|
- subtitle: New collection
|
61
61
|
title: Summer 2019
|
62
|
-
url: /t/summer-
|
62
|
+
url: /t/new-collection/summer-2019
|
63
63
|
image: 'meganav/promo_banner_left-third-category.jpg'
|
64
64
|
- subtitle: Special Offers
|
65
65
|
title: Get up to 30% off
|
66
|
-
url: /t/special-offers
|
66
|
+
url: /t/special-offers/30-off
|
67
67
|
image: 'meganav/promo_banner_right-third-category.jpg'
|
@@ -36,7 +36,7 @@ module Spree
|
|
36
36
|
def extended_base_scope
|
37
37
|
base_scope = Spree::Product.spree_base_scopes.active
|
38
38
|
base_scope = get_products_conditions_for(base_scope, keywords)
|
39
|
-
base_scope = Spree::
|
39
|
+
base_scope = Spree::Dependencies.products_finder.constantize.new(
|
40
40
|
scope: base_scope,
|
41
41
|
params: {
|
42
42
|
filter: {
|
data/lib/spree/core/version.rb
CHANGED
@@ -105,8 +105,8 @@ module Spree
|
|
105
105
|
@@taxonomy_attributes = [:name]
|
106
106
|
|
107
107
|
@@taxon_attributes = [
|
108
|
-
:name, :parent_id, :position, :icon, :description, :permalink, :
|
109
|
-
:meta_description, :meta_keywords, :meta_title, :child_index
|
108
|
+
:name, :parent_id, :position, :icon, :description, :permalink, :hide_from_nav,
|
109
|
+
:taxonomy_id, :meta_description, :meta_keywords, :meta_title, :child_index
|
110
110
|
]
|
111
111
|
|
112
112
|
# TODO: Should probably use something like Spree.user_class.attributes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.0.
|
4
|
+
version: 4.1.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemerchant
|
@@ -945,6 +945,7 @@ files:
|
|
945
945
|
- db/migrate/20191005121504_add_store_id_to_payment_methods.rb
|
946
946
|
- db/migrate/20191016134113_add_deafult_value_for_store_default_currency.rb
|
947
947
|
- db/migrate/20200102141311_add_social_to_spree_stores.rb
|
948
|
+
- db/migrate/20200212144523_add_hide_from_nav_to_taxons.rb
|
948
949
|
- db/seeds.rb
|
949
950
|
- lib/friendly_id/slug_rails5_patch.rb
|
950
951
|
- lib/generators/spree/custom_user/custom_user_generator.rb
|