spree_core 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/spree/base_helper.rb +4 -0
- data/app/helpers/spree/images_helper.rb +27 -14
- data/app/helpers/spree/mail_helper.rb +1 -1
- data/app/models/spree/order/checkout.rb +7 -1
- data/app/models/spree/order/digital.rb +0 -7
- data/app/models/spree/product.rb +2 -2
- data/app/models/spree/shipping_category.rb +6 -0
- data/app/models/spree/store.rb +2 -2
- data/app/models/spree/variant.rb +1 -1
- data/app/views/spree/shared/_payment.html.erb +1 -1
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/testing_support/factories/product_factory.rb +5 -0
- data/lib/spree/testing_support/factories/shipping_category_factory.rb +4 -0
- data/lib/spree/testing_support/factories/shipping_method_factory.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d8a34e50f4423209d4f31a31ef6c40055c0257c83ee28d41655bd0a6c004f83
|
4
|
+
data.tar.gz: 49a23607e20571089a6443447413ea236f02bd5d92518de83ddd334d859b18b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e85f284aeb474a1b25d9b4c9d0f15bfae581cab26a06e7433c74bc54756e837e079eab6aca88f9e895a1f36baee7ab12b6069a839a8c3a006cef5b29f94f02b
|
7
|
+
data.tar.gz: b10269230a1ca074f7de2bc16a31aa7fdd58e858d6e5ae7fd143884e72f67a0b8b4e04754effbfde836ff91763fbc082c5f74311d842f06e550dddc76ffa69b5
|
@@ -9,7 +9,7 @@ module Spree
|
|
9
9
|
# @option options [Integer] :height the height of the image
|
10
10
|
def spree_image_tag(image, options = {})
|
11
11
|
image_tag(
|
12
|
-
spree_image_url(image, { width: options[:width], height: options[:height] }),
|
12
|
+
spree_image_url(image, { width: options[:width], height: options[:height], format: options[:format] }),
|
13
13
|
options
|
14
14
|
)
|
15
15
|
end
|
@@ -18,7 +18,6 @@ module Spree
|
|
18
18
|
return unless image
|
19
19
|
return unless image.variable?
|
20
20
|
return if image.respond_to?(:attached?) && !image.attached?
|
21
|
-
|
22
21
|
url_helpers = respond_to?(:main_app) ? main_app : Rails.application.routes.url_helpers
|
23
22
|
width = options[:width]
|
24
23
|
height = options[:height]
|
@@ -28,11 +27,11 @@ module Spree
|
|
28
27
|
|
29
28
|
if width.present? && height.present?
|
30
29
|
url_helpers.cdn_image_url(
|
31
|
-
image.variant(spree_image_variant_options(resize_to_fill: [width, height]))
|
30
|
+
image.variant(spree_image_variant_options(resize_to_fill: [width, height], format: options[:format]))
|
32
31
|
)
|
33
32
|
else
|
34
33
|
url_helpers.cdn_image_url(
|
35
|
-
image.variant(spree_image_variant_options(resize_to_limit: [width, height]))
|
34
|
+
image.variant(spree_image_variant_options(resize_to_limit: [width, height], format: options[:format]))
|
36
35
|
)
|
37
36
|
end
|
38
37
|
end
|
@@ -77,16 +76,30 @@ module Spree
|
|
77
76
|
# @option options [Integer] :height the height of the image
|
78
77
|
def spree_image_variant_options(options = {})
|
79
78
|
{
|
80
|
-
saver:
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
saver: options[:format] == :png ? png_variant_options : webp_variant_options,
|
80
|
+
format: options[:format] || :webp
|
81
|
+
}.merge(options.except(:format))
|
82
|
+
end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
def webp_variant_options
|
87
|
+
{
|
88
|
+
strip: true,
|
89
|
+
quality: 75,
|
90
|
+
lossless: false,
|
91
|
+
alpha_q: 85,
|
92
|
+
reduction_effort: 6,
|
93
|
+
smart_subsample: true
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
def png_variant_options
|
98
|
+
{
|
99
|
+
strip: true,
|
100
|
+
compression_level: 8,
|
101
|
+
interlace: true
|
102
|
+
}
|
90
103
|
end
|
91
104
|
end
|
92
105
|
end
|
@@ -5,7 +5,7 @@ module Spree
|
|
5
5
|
|
6
6
|
def variant_image_url(variant)
|
7
7
|
image = variant.default_image
|
8
|
-
image.present? && image.attached? ? spree_image_url(image, width: 100, height: 100) : image_url('noimage/small.png')
|
8
|
+
image.present? && image.attached? ? spree_image_url(image, width: 100, height: 100, format: :png) : image_url('noimage/small.png')
|
9
9
|
end
|
10
10
|
|
11
11
|
def name_for(order)
|
@@ -110,7 +110,7 @@ module Spree
|
|
110
110
|
before_transition to: :delivery, do: :create_shipment_tax_charge!
|
111
111
|
before_transition from: :delivery, do: :apply_free_shipping_promotions
|
112
112
|
before_transition to: :delivery, do: :apply_unassigned_promotions
|
113
|
-
after_transition to: :delivery, do: :
|
113
|
+
after_transition to: :delivery, do: :move_to_next_step_if_address_not_required
|
114
114
|
end
|
115
115
|
|
116
116
|
before_transition to: :resumed, do: :ensure_line_item_variants_are_not_discontinued
|
@@ -298,6 +298,12 @@ module Spree
|
|
298
298
|
user && user.default_credit_card.try(:valid?)
|
299
299
|
end
|
300
300
|
|
301
|
+
def move_to_next_step_if_address_not_required
|
302
|
+
return if requires_ship_address?
|
303
|
+
|
304
|
+
next!
|
305
|
+
end
|
306
|
+
|
301
307
|
private
|
302
308
|
|
303
309
|
# For payment step, filter order parameters to produce the expected nested
|
data/app/models/spree/product.rb
CHANGED
@@ -46,7 +46,7 @@ module Spree
|
|
46
46
|
'archived' => 'archived'
|
47
47
|
}.freeze
|
48
48
|
|
49
|
-
TRANSLATABLE_FIELDS = %i[name description slug meta_description
|
49
|
+
TRANSLATABLE_FIELDS = %i[name description slug meta_description meta_title].freeze
|
50
50
|
translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
|
51
51
|
|
52
52
|
self::Translation.class_eval do
|
@@ -251,7 +251,7 @@ module Spree
|
|
251
251
|
delegate method_name, :"#{method_name}=", to: :default_variant
|
252
252
|
end
|
253
253
|
|
254
|
-
delegate :display_amount, :display_price, :has_default_price?,
|
254
|
+
delegate :display_amount, :display_price, :has_default_price?, :track_inventory?,
|
255
255
|
:display_compare_at_price, :images, to: :default_variant
|
256
256
|
|
257
257
|
delegate :name, to: :brand, prefix: true, allow_nil: true
|
@@ -1,5 +1,7 @@
|
|
1
1
|
module Spree
|
2
2
|
class ShippingCategory < Spree.base_class
|
3
|
+
DIGITAL_NAME = 'Digital'
|
4
|
+
|
3
5
|
include Spree::UniqueName
|
4
6
|
if defined?(Spree::Webhooks::HasWebhooks)
|
5
7
|
include Spree::Webhooks::HasWebhooks
|
@@ -10,5 +12,9 @@ module Spree
|
|
10
12
|
has_many :shipping_method_categories
|
11
13
|
end
|
12
14
|
has_many :shipping_methods, through: :shipping_method_categories
|
15
|
+
|
16
|
+
def self.digital
|
17
|
+
find_by(name: DIGITAL_NAME)
|
18
|
+
end
|
13
19
|
end
|
14
20
|
end
|
data/app/models/spree/store.rb
CHANGED
@@ -25,8 +25,8 @@ module Spree
|
|
25
25
|
# Translations
|
26
26
|
#
|
27
27
|
TRANSLATABLE_FIELDS = %i[name meta_description meta_keywords seo_title facebook
|
28
|
-
twitter instagram customer_support_email
|
29
|
-
address contact_phone
|
28
|
+
twitter instagram customer_support_email
|
29
|
+
address contact_phone].freeze
|
30
30
|
translates(*TRANSLATABLE_FIELDS, column_fallback: !Spree.always_use_translations?)
|
31
31
|
self::Translation.class_eval do
|
32
32
|
acts_as_paranoid
|
data/app/models/spree/variant.rb
CHANGED
@@ -74,7 +74,7 @@ module Spree
|
|
74
74
|
after_create :set_master_out_of_stock, unless: :is_master?
|
75
75
|
after_commit :clear_line_items_cache, on: :update
|
76
76
|
|
77
|
-
|
77
|
+
after_save :create_default_stock_item, unless: :track_inventory?
|
78
78
|
after_update_commit :handle_track_inventory_change
|
79
79
|
|
80
80
|
after_commit :remove_prices_from_master_variant, on: [:create, :update], unless: :is_master?
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% elsif payment_method_icon_tag(payment.payment_method.payment_icon_name).present? %>
|
24
24
|
<div class="d-flex flex align-items-center items-center">
|
25
25
|
<div><%= payment_method_icon_tag(payment.payment_method.payment_icon_name) %></div>
|
26
|
-
<div class="
|
26
|
+
<div class="ml-3"><%= Spree.t(:store_credit_name) %></div>
|
27
27
|
</div>
|
28
28
|
<% end %>
|
29
29
|
<% elsif source.present? %>
|
data/lib/spree/core/version.rb
CHANGED
@@ -53,6 +53,11 @@ FactoryBot.define do
|
|
53
53
|
create(:product_property, product: product, property_id: 10, value: 'Epsilon')
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
factory :digital_product do
|
58
|
+
track_inventory { false }
|
59
|
+
shipping_category { |r| Spree::ShippingCategory.digital || r.association(:digital_shipping_category) }
|
60
|
+
end
|
56
61
|
end
|
57
62
|
end
|
58
63
|
end
|
@@ -24,7 +24,7 @@ FactoryBot.define do
|
|
24
24
|
|
25
25
|
before(:create) do |shipping_method|
|
26
26
|
shipping_method.shipping_categories.delete_all
|
27
|
-
shipping_method.shipping_categories << create(:
|
27
|
+
shipping_method.shipping_categories << create(:digital_shipping_category)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-07-
|
13
|
+
date: 2025-07-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n-tasks
|
@@ -1382,9 +1382,9 @@ licenses:
|
|
1382
1382
|
- BSD-3-Clause
|
1383
1383
|
metadata:
|
1384
1384
|
bug_tracker_uri: https://github.com/spree/spree/issues
|
1385
|
-
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.
|
1385
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.1
|
1386
1386
|
documentation_uri: https://docs.spreecommerce.org/
|
1387
|
-
source_code_uri: https://github.com/spree/spree/tree/v5.1.
|
1387
|
+
source_code_uri: https://github.com/spree/spree/tree/v5.1.1
|
1388
1388
|
post_install_message:
|
1389
1389
|
rdoc_options: []
|
1390
1390
|
require_paths:
|