spree_storefront 5.0.4 → 5.0.6
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/controllers/concerns/spree/storefront/devise_concern.rb +48 -0
- data/app/controllers/spree/line_items_controller.rb +14 -7
- data/app/controllers/spree/products_controller.rb +1 -1
- data/app/controllers/spree/search_controller.rb +1 -1
- data/app/controllers/spree/store_controller.rb +17 -15
- data/app/helpers/spree/cart_helper.rb +1 -1
- data/app/helpers/spree/filters_helper.rb +5 -1
- data/app/helpers/spree/products_helper.rb +5 -1
- data/app/helpers/spree/storefront_helper.rb +10 -2
- data/app/javascript/spree/storefront/controllers/card_validation_controller.js +2 -0
- data/app/javascript/spree/storefront/controllers/cart_controller.js +5 -0
- data/app/views/devise/passwords/edit.html.erb +1 -1
- data/app/views/devise/registrations/new.html.erb +1 -1
- data/app/views/devise/shared/_links.html.erb +3 -3
- data/app/views/spree/addresses/edit.html.erb +2 -2
- data/app/views/spree/checkout/_address.html.erb +3 -4
- data/app/views/spree/checkout/_coupon_code.html.erb +1 -1
- data/app/views/spree/checkout/_delivery.html.erb +1 -2
- data/app/views/spree/checkout/_missing_all_line_items.html.erb +2 -2
- data/app/views/spree/checkout/_payment_methods.html.erb +1 -1
- data/app/views/spree/checkout/_summary.html.erb +45 -44
- data/app/views/spree/checkout/payment/_gateway.html.erb +12 -12
- data/app/views/spree/line_items/destroy.turbo_stream.erb +14 -8
- data/app/views/spree/seo/sitemap.xml.erb +2 -2
- data/app/views/themes/default/spree/account/_order.html.erb +5 -5
- data/app/views/themes/default/spree/checkout/complete.html.erb +1 -1
- data/app/views/themes/default/spree/orders/_line_item.html.erb +3 -3
- data/app/views/themes/default/spree/page_sections/_featured_posts.html.erb +56 -0
- data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +1 -1
- data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +2 -2
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +4 -5
- data/app/views/themes/default/spree/policies/show.html.erb +11 -7
- data/app/views/themes/default/spree/posts/_post.html.erb +20 -11
- data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +4 -4
- data/app/views/themes/default/spree/products/_details.html.erb +1 -1
- data/app/views/themes/default/spree/products/_json_ld.html.erb +1 -1
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +1 -1
- data/app/views/themes/default/spree/products/_media_gallery.html.erb +1 -2
- data/app/views/themes/default/spree/products/filters/_availability.html.erb +1 -1
- data/app/views/themes/default/spree/products/filters/_price.html.erb +4 -4
- data/app/views/themes/default/spree/shared/_account_pane.html.erb +1 -1
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +4 -2
- data/app/views/themes/default/spree/shared/_cart_pane.html.erb +6 -3
- data/app/views/themes/default/spree/shared/_meta_tags.html.erb +2 -2
- data/config/locales/en.yml +8 -0
- data/lib/generators/spree/storefront/devise/devise_generator.rb +47 -0
- data/lib/generators/spree/storefront/devise/templates/user_passwords_controller.rb +17 -0
- data/lib/generators/spree/storefront/devise/templates/user_registrations_controller.rb +17 -0
- data/lib/generators/spree/storefront/devise/templates/user_sessions_controller.rb +17 -0
- data/lib/generators/spree/storefront/theme/templates/model.rb.tt +91 -4
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d758772259f4e6e3ffd355b4252f2422bf78263a988a818c48e48d0c377655b
|
4
|
+
data.tar.gz: 49bbc7a193bdd072668c0de6ffce9586a1cc3b3b0c62be40e89b3c2313720ef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d129a479969498e9a6106a462ac4db503da5bf9ffae3a721c91ee74d3291bb3353fed199e0ac47bfcc3d96db1ea80fdd2422d32b9c2bb4450a28aaefb08aa8b1
|
7
|
+
data.tar.gz: ed4de551790ba08151199da2500b12f04f2b2d35573baa2c9c141436b04ff80547b551c0e48132994d74569a1cb4b05dffc1a1839853d74c5cd7d38622c655bb
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# This concern is used to include the necessary methods and helpers for the Devise controllers
|
2
|
+
# It is used to avoid repeating the same code in each controller
|
3
|
+
module Spree
|
4
|
+
module Storefront
|
5
|
+
module DeviseConcern
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
helper_method :title
|
10
|
+
helper_method :stored_location
|
11
|
+
layout 'spree/storefront'
|
12
|
+
|
13
|
+
include Spree::Core::ControllerHelpers::Auth
|
14
|
+
include Spree::Core::ControllerHelpers::Store
|
15
|
+
include Spree::Core::ControllerHelpers::Order
|
16
|
+
include Spree::Core::ControllerHelpers::StrongParameters
|
17
|
+
include Spree::Core::ControllerHelpers::Locale
|
18
|
+
include Spree::Core::ControllerHelpers::Currency
|
19
|
+
include Spree::Core::ControllerHelpers::Turbo
|
20
|
+
include Spree::LocaleUrls
|
21
|
+
include Spree::ThemeConcern
|
22
|
+
include Spree::IntegrationsHelper if defined?(Spree::IntegrationsHelper)
|
23
|
+
|
24
|
+
helper 'spree/wishlist'
|
25
|
+
helper 'spree/currency'
|
26
|
+
helper 'spree/locale'
|
27
|
+
helper 'spree/storefront_locale'
|
28
|
+
helper 'spree/integrations' if defined?(Spree::IntegrationsHelper)
|
29
|
+
end
|
30
|
+
|
31
|
+
def stored_location
|
32
|
+
return unless defined?(after_sign_in_path_for)
|
33
|
+
return unless defined?(store_location_for)
|
34
|
+
return unless defined?(Devise)
|
35
|
+
|
36
|
+
path = after_sign_in_path_for(Devise.mappings.keys.first)
|
37
|
+
|
38
|
+
store_location_for(Devise.mappings.keys.first, path)
|
39
|
+
|
40
|
+
path
|
41
|
+
end
|
42
|
+
|
43
|
+
def password_path(_resource_or_scope = nil)
|
44
|
+
send("#{Spree.user_class.model_name.singular_route_key}_password_path")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -22,8 +22,6 @@ module Spree
|
|
22
22
|
quantity: @quantity,
|
23
23
|
options: options)
|
24
24
|
|
25
|
-
flash.now[:error] = result.value.errors.full_messages.to_sentence if result.failure?
|
26
|
-
|
27
25
|
@line_item = result.value
|
28
26
|
|
29
27
|
if result.success?
|
@@ -45,9 +43,12 @@ module Spree
|
|
45
43
|
quantity = line_item_params[:quantity]&.to_i || 1
|
46
44
|
result = cart_set_item_quantity_service.call(order: @order, line_item: @line_item, quantity: quantity)
|
47
45
|
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
if result.success?
|
47
|
+
load_line_items
|
48
|
+
else
|
49
|
+
@error = result.value.errors.full_messages.to_sentence
|
50
|
+
flash.now[:error] = @error
|
51
|
+
end
|
51
52
|
|
52
53
|
respond_to do |format|
|
53
54
|
format.turbo_stream
|
@@ -57,9 +58,15 @@ module Spree
|
|
57
58
|
|
58
59
|
def destroy
|
59
60
|
result = cart_remove_line_item_service.call(order: @order, line_item: @line_item)
|
60
|
-
load_line_items if result.success?
|
61
61
|
|
62
|
-
|
62
|
+
if result.success?
|
63
|
+
load_line_items
|
64
|
+
|
65
|
+
track_event('product_removed', { line_item: @line_item })
|
66
|
+
else
|
67
|
+
@error = result.value.errors.full_messages.to_sentence
|
68
|
+
flash.now[:error] = @error
|
69
|
+
end
|
63
70
|
|
64
71
|
respond_to do |format|
|
65
72
|
format.turbo_stream
|
@@ -23,7 +23,7 @@ module Spree
|
|
23
23
|
load_product
|
24
24
|
# An interesting thing is that since we're querying the translations table (in the multi_search),
|
25
25
|
# when using not default locale, our related products are different for different locales.
|
26
|
-
@products =
|
26
|
+
@products = storefront_products_scope.where.not(id: @product.id).
|
27
27
|
multi_search(@product.name).includes(storefront_products_includes).
|
28
28
|
limit(@section.preferred_max_products_to_show)
|
29
29
|
end
|
@@ -13,7 +13,7 @@ module Spree
|
|
13
13
|
@taxons = []
|
14
14
|
|
15
15
|
if query.present? && query.length >= Spree::Storefront::Config.search_min_query_length
|
16
|
-
products_scope =
|
16
|
+
products_scope = storefront_products_scope.multi_search(query)
|
17
17
|
@products = products_scope.includes(storefront_products_includes)
|
18
18
|
@taxons = current_store.taxons.search_by_name(query)
|
19
19
|
end
|
@@ -116,29 +116,31 @@ module Spree
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def storefront_products_scope
|
119
|
-
current_store.products.active(current_currency)
|
119
|
+
@storefront_products_scope ||= current_store.products.active(current_currency)
|
120
120
|
end
|
121
121
|
|
122
122
|
def default_products_finder_params
|
123
|
-
|
123
|
+
@default_products_finder_params ||= begin
|
124
|
+
taxon = @taxon || current_taxon
|
124
125
|
|
125
|
-
|
126
|
+
filter = permitted_products_params.fetch(:filter, {}).dup
|
126
127
|
|
127
|
-
|
128
|
-
|
128
|
+
filter[:taxon_ids] ||= [taxon&.id.to_s].compact
|
129
|
+
filter[:taxons] = filter[:taxon_ids].join(',')
|
129
130
|
|
130
|
-
|
131
|
-
|
132
|
-
|
131
|
+
if filter.key?(:min_price) || filter.key?(:max_price)
|
132
|
+
min_price = filter[:min_price].presence || 0
|
133
|
+
max_price = filter[:max_price].presence || 'Infinity'
|
133
134
|
|
134
|
-
|
135
|
-
|
135
|
+
filter[:price] = [min_price, max_price].compact.join(',')
|
136
|
+
end
|
136
137
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
138
|
+
permitted_products_params.merge(
|
139
|
+
store: current_store,
|
140
|
+
filter: filter,
|
141
|
+
currency: current_currency
|
142
|
+
)
|
143
|
+
end
|
142
144
|
end
|
143
145
|
|
144
146
|
def storefront_products
|
@@ -22,7 +22,7 @@ module Spree
|
|
22
22
|
class: opts[:class],
|
23
23
|
data: {
|
24
24
|
'quantity-picker-target': opts[:action],
|
25
|
-
action: "click->quantity-picker##{opts[:action]} click->cart#disableCart"
|
25
|
+
action: "click->quantity-picker##{opts[:action]} click->cart#disableCart turbo-stream-form:submit-end->cart#enableCart"
|
26
26
|
}
|
27
27
|
)
|
28
28
|
end
|
@@ -76,10 +76,14 @@ module Spree
|
|
76
76
|
if filter_selected
|
77
77
|
default_storefront_filter_values_scope
|
78
78
|
else
|
79
|
-
|
79
|
+
all_option_values_scope
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
def all_option_values_scope
|
84
|
+
@all_option_values_scope ||= Spree::OptionValue.for_products(storefront_products_scope).distinct
|
85
|
+
end
|
86
|
+
|
83
87
|
def filter_values_for_filter(filter)
|
84
88
|
selected = single_option_filter_selected?(filter.name)
|
85
89
|
if filter.option_values.loaded?
|
@@ -157,7 +157,7 @@ module Spree
|
|
157
157
|
{
|
158
158
|
'@type' => 'ListItem',
|
159
159
|
'position' => index + 1,
|
160
|
-
'url' => spree.product_url(product_slug)
|
160
|
+
'url' => spree.product_url(product_slug, host: current_store.url_or_custom_domain)
|
161
161
|
}
|
162
162
|
end
|
163
163
|
end
|
@@ -201,5 +201,9 @@ module Spree
|
|
201
201
|
|
202
202
|
Spree::ColorsPreviewStylesPresenter.new(option_type.option_values.map { |ov| { name: ov.name, filter_name: ov.name } }).to_s
|
203
203
|
end
|
204
|
+
|
205
|
+
def product_properties(product)
|
206
|
+
product.product_properties.joins(:property).merge(Spree::Property.available_on_front_end).sort_by_property_position
|
207
|
+
end
|
204
208
|
end
|
205
209
|
end
|
@@ -52,8 +52,16 @@ module Spree
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def svg_country_icon(country_code)
|
55
|
-
|
56
|
-
|
55
|
+
language_to_country = {
|
56
|
+
'en' => 'us',
|
57
|
+
'ja' => 'jp',
|
58
|
+
'uk' => 'ua'
|
59
|
+
}
|
60
|
+
|
61
|
+
normalized_code = country_code.to_s.downcase
|
62
|
+
final_country_code = language_to_country.fetch(normalized_code, normalized_code)
|
63
|
+
|
64
|
+
tag.span(class: "fi fi-#{final_country_code}")
|
57
65
|
end
|
58
66
|
|
59
67
|
def show_account_pane?
|
@@ -56,6 +56,8 @@ export default class extends Controller {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
updateCardIcon(cardType) {
|
59
|
+
cardType = (cardType === "mastercard" ? "master" : cardType)
|
60
|
+
|
59
61
|
const iconElement = document.getElementById(`credit-card-icon-${cardType}`)
|
60
62
|
if (iconElement) {
|
61
63
|
this.typeContainerTarget.innerHTML = iconElement.innerHTML
|
@@ -7,4 +7,9 @@ export default class extends Controller {
|
|
7
7
|
this.containerTarget.classList.add('pointer-events-none', 'opacity-50')
|
8
8
|
this.spinnerTarget.classList.remove('hidden')
|
9
9
|
}
|
10
|
+
|
11
|
+
enableCart() {
|
12
|
+
this.containerTarget.classList.remove('pointer-events-none', 'opacity-50')
|
13
|
+
this.spinnerTarget.classList.add('hidden')
|
14
|
+
}
|
10
15
|
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div class="flex flex-col mb-4">
|
7
7
|
<%= f.label :password, Spree.t(:password) %>
|
8
8
|
<% if @minimum_password_length %>
|
9
|
-
<em
|
9
|
+
<em><%= Spree.t(:minimum_password_length, count: @minimum_password_length) %></em>
|
10
10
|
<% end %>
|
11
11
|
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: 'text-input', required: true %>
|
12
12
|
</div>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<div class="flex flex-col mb-4">
|
11
11
|
<%= f.label :password, Spree.t(:password) %>
|
12
12
|
<% if @minimum_password_length %>
|
13
|
-
<em
|
13
|
+
<em><%= Spree.t(:minimum_password_length, count: @minimum_password_length) %></em>
|
14
14
|
<% end %>
|
15
15
|
<%= f.password_field :password, autocomplete: "new-password", class: 'text-input', required: true %>
|
16
16
|
</div>
|
@@ -9,14 +9,14 @@
|
|
9
9
|
<%= link_to Spree.t(:forgot_password), new_password_path(resource_name) %>
|
10
10
|
<% end %>
|
11
11
|
<%- if devise_mapping.confirmable? && controller_name != 'user_confirmations' %>
|
12
|
-
<%= link_to
|
12
|
+
<%= link_to Spree.t(:didn_t_receive_confirmation_instructions), new_confirmation_path(resource_name) %>
|
13
13
|
<% end %>
|
14
14
|
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'user_unlocks' %>
|
15
|
-
<%= link_to
|
15
|
+
<%= link_to Spree.t(:didn_t_receive_unlock_instructions), new_unlock_path(resource_name) %>
|
16
16
|
<% end %>
|
17
17
|
<%- if devise_mapping.omniauthable? %>
|
18
18
|
<%- resource_class.omniauth_providers.each do |provider| %>
|
19
|
-
<%= button_to
|
19
|
+
<%= button_to Spree.t(:sign_in_with_provider, provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
</div>
|
@@ -38,13 +38,13 @@
|
|
38
38
|
<%= check_box_tag "default_shipping", "true", @address.user_default_shipping?,
|
39
39
|
class: 'input-checkbox input-address-default',
|
40
40
|
disabled: @address.user_default_shipping? %>
|
41
|
-
|
41
|
+
<%= Spree.t("address_book.set_as_default_delivery_address") %>
|
42
42
|
<% end %>
|
43
43
|
<%= label_tag "default_billing", class: "flex items-center gap-2 text-sm mb-4" do %>
|
44
44
|
<%= check_box_tag "default_billing", "true", @address.user_default_billing?,
|
45
45
|
class: 'input-checkbox input-address-default',
|
46
46
|
disabled: @address.user_default_billing? %>
|
47
|
-
|
47
|
+
<%= Spree.t("address_book.set_as_default_billing_address") %>
|
48
48
|
<% end %>
|
49
49
|
</div>
|
50
50
|
<div class="border-t border-default -mx-4 lg:mx-0 px-4 flex justify-end items-center gap-4 py-6 lg:px-8">
|
@@ -49,7 +49,7 @@
|
|
49
49
|
<% end %>
|
50
50
|
</div>
|
51
51
|
</label>
|
52
|
-
</
|
52
|
+
</div>
|
53
53
|
</li>
|
54
54
|
</ul>
|
55
55
|
</div>
|
@@ -115,8 +115,7 @@
|
|
115
115
|
<% unless try_spree_current_user %>
|
116
116
|
<% if already_have_an_account? %>
|
117
117
|
<div class="py-2 text-sm">
|
118
|
-
|
119
|
-
<%= link_to Spree.t(:login), spree_login_path, class: 'text-primary font-semibold' %> to continue.
|
118
|
+
<%= Spree.t("storefront.checkout.it_seems_you_already_have_an_account_html", link: link_to(Spree.t(:login), spree_login_path, class: 'text-primary font-semibold')) %>
|
120
119
|
</div>
|
121
120
|
<% end %>
|
122
121
|
<% end %>
|
@@ -132,7 +131,7 @@
|
|
132
131
|
address_name: address_name,
|
133
132
|
address_form: address_form,
|
134
133
|
address_type: address_type,
|
135
|
-
address: Spree::Address.new(country: current_store.default_country, user: try_spree_current_user),
|
134
|
+
address: address_form.object.persisted? ? address_form.object : Spree::Address.new(country: current_store.default_country, user: try_spree_current_user),
|
136
135
|
form: form
|
137
136
|
} %>
|
138
137
|
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
aria: { label: Spree.t('cart_page.add_promo_code') },
|
9
9
|
data: { 'enable-button-target': 'input' },
|
10
10
|
required: true %>
|
11
|
-
<%= button_tag
|
11
|
+
<%= button_tag Spree.t(:apply), class: 'min-h-full ml-3 btn-primary !px-4 !py-3', data: { 'enable-button-target': 'button' }, disabled: true %>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
14
14
|
<% elsif promotion.present? %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div id="shipping-method">
|
7
7
|
<% if @order.backordered_variants.any? %>
|
8
8
|
<div class="alert rounded border border-default text-sm p-5 mb-6">
|
9
|
-
|
9
|
+
<%= Spree.t("storefront.checkout.backorder_notice") %>
|
10
10
|
<ul class="list-disc list-inside flex-col flex space-y-1 mt-2">
|
11
11
|
<% @order.backordered_variants.each do |variant| %>
|
12
12
|
<li><%= variant.name %></li>
|
@@ -67,4 +67,3 @@
|
|
67
67
|
</div>
|
68
68
|
</div>
|
69
69
|
<% end %>
|
70
|
-
|
@@ -7,8 +7,8 @@
|
|
7
7
|
<p class="mb-4"><%= Spree.t('errors.messages.no_shipping_methods_available') %> </p>
|
8
8
|
|
9
9
|
<div class="flex justify-end items-center flex-wrap mt-6">
|
10
|
-
<%= link_to
|
11
|
-
<%= link_to
|
10
|
+
<%= link_to Spree.t("storefront.checkout.return_to_cart"), spree.cart_path, class: 'mx-4 py-4', target: :_top %>
|
11
|
+
<%= link_to Spree.t(:close), checkout_state_path(@order.token, @order.state), class: 'btn-primary font-semibold checkout-content-save-continue-button my-5 ml-4 !py-4', target: :_top %>
|
12
12
|
</div>
|
13
13
|
</div>
|
14
14
|
</div>
|
@@ -47,70 +47,71 @@
|
|
47
47
|
<span>
|
48
48
|
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
49
49
|
</span>
|
50
|
-
|
50
|
+
</div>
|
51
51
|
<% end %>
|
52
52
|
<% end %>
|
53
|
-
<% elsif order.state == 'address' %>
|
54
|
-
<div class="flex justify-between items-center mb-2">
|
55
|
-
<span><%= Spree.t(:shipping) %>:</span>
|
56
|
-
<span class="text-xs text-gray-500"><%= Spree.t('storefront.checkout.calculated_at_next_step') %></span>
|
57
|
-
</div>
|
58
53
|
<% end %>
|
54
|
+
<% elsif order.state == 'address' %>
|
55
|
+
<div class="flex justify-between items-center mb-2">
|
56
|
+
<span><%= Spree.t(:shipping) %>:</span>
|
57
|
+
<span class="text-xs text-gray-500"><%= Spree.t('storefront.checkout.calculated_at_next_step') %></span>
|
58
|
+
</div>
|
59
|
+
<% end %>
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
<% if order.payment? || order.completed? %>
|
62
|
+
<% cache spree_base_cache_scope.call(order.all_adjustments.nonzero.tax.eligible.cache_key_with_version) do %>
|
63
|
+
<% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
|
64
|
+
<div class="flex justify-between items-center mb-2">
|
65
|
+
<span><%= label %></span>
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<% end %>
|
67
|
+
<% tax_total = Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
|
68
|
+
<span><%= tax_total.to_html %></span>
|
69
|
+
</div>
|
70
70
|
<% end %>
|
71
71
|
<% end %>
|
72
|
+
<% end %>
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
<% if order.adjustments.nonzero.non_tax.eligible.exists? %>
|
75
|
+
<% order.adjustments.nonzero.non_tax.eligible.each do |adjustment| %>
|
76
|
+
<div class="flex justify-between items-center mb-2">
|
76
77
|
<span>
|
77
78
|
<%= adjustment.label %>:
|
78
79
|
</span>
|
79
|
-
|
80
|
+
<span>
|
80
81
|
<%= adjustment.display_amount.to_html %>
|
81
82
|
</span>
|
82
|
-
</div>
|
83
|
-
<% end %>
|
84
|
-
<% end %>
|
85
|
-
|
86
|
-
<% if order.respond_to?(:gift_card) && order.gift_card.present? %>
|
87
|
-
<div class="flex justify-between items-center mb-2">
|
88
|
-
<span><%= Spree.t(:gift_card) %>:</span>
|
89
|
-
<span>-<%= order.display_gift_card_total %></span>
|
90
|
-
</div>
|
91
|
-
<% elsif order.using_store_credit? %>
|
92
|
-
<div class="flex justify-between items-center mb-2">
|
93
|
-
<span>Store credit:</span>
|
94
|
-
<span><%= order.display_total_applied_store_credit %></span>
|
95
83
|
</div>
|
96
84
|
<% end %>
|
85
|
+
<% end %>
|
97
86
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
87
|
+
<% if order.respond_to?(:gift_card) && order.gift_card.present? %>
|
88
|
+
<div class="flex justify-between items-center mb-2">
|
89
|
+
<span><%= Spree.t(:gift_card) %>:</span>
|
90
|
+
<span>-<%= order.display_gift_card_total %></span>
|
91
|
+
</div>
|
92
|
+
<% elsif order.using_store_credit? %>
|
93
|
+
<div class="flex justify-between items-center mb-2">
|
94
|
+
<span><%= Spree.t(:store_credit_name) %>:</span>
|
95
|
+
<span><%= order.display_total_applied_store_credit %></span>
|
96
|
+
</div>
|
97
|
+
<% end %>
|
98
|
+
|
99
|
+
<div>
|
100
|
+
<div class="flex justify-between items-center">
|
101
|
+
<span class="font-bold text-lg"><%= Spree.t(:total) %></span>
|
102
|
+
<div class="">
|
103
|
+
<span class="text-xs mr-1"><%= order.currency.upcase %></span>
|
104
|
+
<span class="font-semibold text-lg inline" id='summary-order-total' data-currency="<%= Money::Currency.find(order.currency).symbol %>">
|
104
105
|
<%= order.display_total_minus_store_credits.to_html %>
|
105
106
|
</span>
|
106
|
-
</div>
|
107
107
|
</div>
|
108
108
|
</div>
|
109
109
|
</div>
|
110
|
-
<% end %>
|
111
|
-
|
112
|
-
<div id="checkout-message" class="mt-8">
|
113
|
-
<%= current_store.checkout_message if current_store.checkout_message.present? %>
|
114
110
|
</div>
|
111
|
+
<% end %>
|
112
|
+
|
113
|
+
<div id="checkout-message" class="mt-8">
|
114
|
+
<%= current_store.checkout_message if current_store.checkout_message.present? %>
|
115
115
|
</div>
|
116
|
-
|
116
|
+
</div>
|
117
|
+
<% end %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="form-group mb-3 relative">
|
12
12
|
<% options_hash = Rails.env.production? ? {autocomplete: 'off'} : {} %>
|
13
13
|
<label for="card_number" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:card_number) %></label>
|
14
|
-
<%= text_field_tag "#{param_prefix}[number]", '',
|
14
|
+
<%= text_field_tag "#{param_prefix}[number]", '',
|
15
15
|
options_hash.merge(
|
16
16
|
id: 'card_number',
|
17
17
|
data: { card_validation_target: "number" },
|
@@ -23,7 +23,7 @@
|
|
23
23
|
required: true
|
24
24
|
)
|
25
25
|
%>
|
26
|
-
<div class="absolute right-2 top-7"
|
26
|
+
<div class="absolute right-2 top-7"
|
27
27
|
data-card-validation-target="typeContainer"
|
28
28
|
id="credit-card-type-container">
|
29
29
|
</div>
|
@@ -32,37 +32,37 @@
|
|
32
32
|
<div class="flex gap-3">
|
33
33
|
<div class="form-group">
|
34
34
|
<label for="card_expiry" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:expiration_date) %></label>
|
35
|
-
<%= text_field_tag "#{param_prefix}[expiry]", '',
|
36
|
-
id: 'card_expiry',
|
35
|
+
<%= text_field_tag "#{param_prefix}[expiry]", '',
|
36
|
+
id: 'card_expiry',
|
37
37
|
class: 'text-input',
|
38
38
|
data: {
|
39
39
|
card_validation_target: "expiry"
|
40
40
|
},
|
41
|
-
placeholder:
|
41
|
+
placeholder: Spree.t(:card_expiration_placeholder),
|
42
42
|
required: true
|
43
43
|
%>
|
44
44
|
</div>
|
45
45
|
<div class="form-group">
|
46
46
|
<label for="card_code" class="block text-xs text-neutral-600 mb-1"><%= Spree.t(:cvv) %></label>
|
47
|
-
<%= text_field_tag "#{param_prefix}[verification_value]", '',
|
47
|
+
<%= text_field_tag "#{param_prefix}[verification_value]", '',
|
48
48
|
options_hash.merge(
|
49
|
-
id: 'card_code',
|
50
|
-
class: 'text-input',
|
49
|
+
id: 'card_code',
|
50
|
+
class: 'text-input',
|
51
51
|
data: { card_validation_target: "cvv" },
|
52
52
|
size: 4,
|
53
53
|
maxlength: 4,
|
54
54
|
pattern: '[0-9]*',
|
55
55
|
inputmode: 'numeric',
|
56
|
-
placeholder: Spree.t(:cvv),
|
56
|
+
placeholder: Spree.t(:cvv),
|
57
57
|
required: true
|
58
|
-
)
|
58
|
+
)
|
59
59
|
%>
|
60
60
|
</div>
|
61
61
|
</div>
|
62
62
|
|
63
|
-
<%= hidden_field_tag "#{param_prefix}[cc_type]", '',
|
63
|
+
<%= hidden_field_tag "#{param_prefix}[cc_type]", '',
|
64
64
|
id: "cc_type",
|
65
|
-
data: { card_validation_target: "ccType" }
|
65
|
+
data: { card_validation_target: "ccType" }
|
66
66
|
%>
|
67
67
|
|
68
68
|
<% PaymentIcon.credit_cards.each do |card| %>
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
|
-
<%=
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<% if flash[:error] %>
|
2
|
+
<%= spree_turbo_update_flashes %>
|
3
|
+
<% else %>
|
4
|
+
<%= turbo_stream.replace_all '.cart-contents' do %>
|
5
|
+
<%= turbo_frame_tag cart_id(@order), class: 'cart-contents' do %>
|
6
|
+
<% if @order.line_items.empty? %>
|
7
|
+
<%= render 'spree/orders/empty' %>
|
8
|
+
<% else %>
|
9
|
+
<%= render 'spree/orders/cart' %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= render_storefront_partials(:remove_from_cart_partials) %>
|
7
13
|
<% end %>
|
8
14
|
<% end %>
|
9
|
-
<% end %>
|
10
15
|
|
11
|
-
<%= spree_turbo_update_cart(@order) %>
|
16
|
+
<%= spree_turbo_update_cart(@order) %>
|
17
|
+
<% end %>
|
@@ -12,8 +12,8 @@
|
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
|
15
|
-
<% cache [
|
16
|
-
<%
|
15
|
+
<% cache [storefront_products_scope, current_currency] do %>
|
16
|
+
<% storefront_products_scope.find_each do |product| %>
|
17
17
|
<url>
|
18
18
|
<loc><%= spree_storefront_resource_url(product) %></loc>
|
19
19
|
<lastmod><%= product.updated_at.strftime('%Y-%m-%d') %></lastmod>
|