spree_storefront 5.0.3 → 5.0.5

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/storefront_page_builder.css +12 -7
  3. data/app/controllers/spree/account/wished_items_controller.rb +0 -2
  4. data/app/controllers/spree/line_items_controller.rb +14 -7
  5. data/app/controllers/spree/products_controller.rb +1 -1
  6. data/app/controllers/spree/search_controller.rb +1 -1
  7. data/app/controllers/spree/store_controller.rb +17 -15
  8. data/app/helpers/spree/cart_helper.rb +1 -1
  9. data/app/helpers/spree/filters_helper.rb +5 -1
  10. data/app/helpers/spree/fonts_helper.rb +3 -1
  11. data/app/helpers/spree/products_helper.rb +5 -1
  12. data/app/helpers/spree/storefront_helper.rb +1 -0
  13. data/app/javascript/spree/storefront/controllers/card_validation_controller.js +2 -0
  14. data/app/javascript/spree/storefront/controllers/cart_controller.js +5 -0
  15. data/app/javascript/spree/storefront/controllers/quantity_picker_controller.js +16 -9
  16. data/app/javascript/spree/storefront/controllers/wished_item_controller.js +4 -2
  17. data/app/views/devise/passwords/edit.html.erb +1 -1
  18. data/app/views/devise/registrations/new.html.erb +1 -1
  19. data/app/views/devise/shared/_links.html.erb +3 -3
  20. data/app/views/layouts/spree/checkout.html.erb +1 -1
  21. data/app/views/layouts/spree/storefront.html.erb +1 -1
  22. data/app/views/spree/addresses/edit.html.erb +2 -2
  23. data/app/views/spree/checkout/_address.html.erb +3 -4
  24. data/app/views/spree/checkout/_coupon_code.html.erb +1 -1
  25. data/app/views/spree/checkout/_delivery.html.erb +1 -2
  26. data/app/views/spree/checkout/_missing_all_line_items.html.erb +2 -2
  27. data/app/views/spree/checkout/_payment_methods.html.erb +1 -1
  28. data/app/views/spree/checkout/_summary.html.erb +45 -44
  29. data/app/views/spree/checkout/payment/_gateway.html.erb +12 -12
  30. data/app/views/spree/line_items/destroy.turbo_stream.erb +14 -8
  31. data/app/views/spree/seo/sitemap.xml.erb +2 -2
  32. data/app/views/themes/default/spree/account/_order.html.erb +5 -5
  33. data/app/views/themes/default/spree/checkout/complete.html.erb +1 -1
  34. data/app/views/themes/default/spree/orders/_line_item.html.erb +3 -3
  35. data/app/views/themes/default/spree/orders/_line_item_quantity.html.erb +1 -1
  36. data/app/views/themes/default/spree/page_sections/_featured_posts.html.erb +56 -0
  37. data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +1 -1
  38. data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +2 -2
  39. data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +4 -5
  40. data/app/views/themes/default/spree/page_sections/_newsletter.html.erb +1 -1
  41. data/app/views/themes/default/spree/page_sections/_product_grid.html.erb +16 -9
  42. data/app/views/themes/default/spree/policies/show.html.erb +11 -7
  43. data/app/views/themes/default/spree/posts/_post.html.erb +20 -11
  44. data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +4 -4
  45. data/app/views/themes/default/spree/products/_add_to_wishlist.html.erb +2 -0
  46. data/app/views/themes/default/spree/products/_details.html.erb +1 -1
  47. data/app/views/themes/default/spree/products/_json_ld.html.erb +1 -1
  48. data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +1 -1
  49. data/app/views/themes/default/spree/products/_media_gallery.html.erb +1 -2
  50. data/app/views/themes/default/spree/products/filters/_availability.html.erb +1 -1
  51. data/app/views/themes/default/spree/products/filters/_price.html.erb +4 -4
  52. data/app/views/themes/default/spree/shared/_cart_icon.html.erb +4 -2
  53. data/app/views/themes/default/spree/shared/_cart_pane.html.erb +5 -2
  54. data/app/views/themes/default/spree/shared/_meta_tags.html.erb +2 -2
  55. data/config/locales/en.yml +8 -0
  56. data/lib/generators/spree/storefront/theme/templates/model.rb.tt +91 -4
  57. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a3165bdc79f4acc7b7ac36a86572a2f6d114fdacc1b125af2b0e86d21983d92
4
- data.tar.gz: 852b2926ade744ce9b0c41f0d5f04d68b10c3d5408100b3531dea0966b663fee
3
+ metadata.gz: d8b5f53e77331921922ac1da27123087c2b06413b7e77bb9061709a3f4c331a6
4
+ data.tar.gz: 72d769742b732a7d2500dc4ce2ab6d25217198ac40d5010273b9ffb55a815a01
5
5
  SHA512:
6
- metadata.gz: 2727b7cca478cbe94b87e22cca326b11259138f2e36069487d546bb865cc4ca6952b05e94595350e31907916acb2c1d6f1a22ba45e3dbf382cf3c3af5c000aad
7
- data.tar.gz: 5bfc483ae97000fe62611cb3cd7fd39eca7c28104e8a193016a5e21dcf35ec2ee526c8fd1311cd2a4de42dfa95cafec65a5d791ceec662d586b92774d35daa48
6
+ metadata.gz: e9eb50e07eee8427553b3ff7afb6e4e87a409c7a2bfdd0aa1fae44d31e146ef1595750f79e3a1e4a296390dfc3c9e9b589d17f3e3bf7131f277f859be4ea841d
7
+ data.tar.gz: 20e8fc5511fbedf98f50cdfe492e4765ca15fe39de324bd4988a2d03ac8b80b5e0a098cb59f0488d73b03cb75f086f02ef3bea757dbd6d0b5e3c434286cf7d88
@@ -1,22 +1,18 @@
1
1
  .editor-overlay {
2
2
  z-index: 1089;
3
3
  width: 100%;
4
+ container-type: inline-size;
5
+ container-name: editor-overlay;
4
6
  }
5
7
 
6
8
  .editor-overlay-toolbar {
7
9
  position: absolute;
8
- top: -26px;
9
- left: -1px;
10
+ min-width: max-content;
10
11
  background-color: #0081f1;
11
12
  color: #fff;
12
- padding: 4px 8px;
13
13
  font-size: 12px;
14
14
  font-weight: bold;
15
- border-radius: 4px 4px 0 0;
16
- cursor: pointer;
17
15
  display: none;
18
- }
19
- .editor-overlay-toolbar {
20
16
  right: 2px;
21
17
  top: 2px;
22
18
  left: auto;
@@ -25,6 +21,15 @@
25
21
  padding: 2px 2px;
26
22
  border-radius: 4px;
27
23
  }
24
+
25
+ /* If the editor overlay is really small, move the toolbar to the bottom so it doesn't cover the content */
26
+ @container editor-overlay (max-width: 200px) {
27
+ .editor-overlay-toolbar {
28
+ top: 100%;
29
+ right: 0px;
30
+ }
31
+ }
32
+
28
33
  .editor-overlay-toolbar button {
29
34
  padding: 8px;
30
35
  border-radius: 4px;
@@ -1,8 +1,6 @@
1
1
  module Spree
2
2
  module Account
3
3
  class WishedItemsController < BaseController
4
- skip_before_action :verify_authenticity_token
5
-
6
4
  # POST /account/wished_items
7
5
  def create
8
6
  variant = current_store.variants.find(wished_item_params[:variant_id])
@@ -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
- @error = result.value.errors.full_messages.to_sentence if result.failure?
49
-
50
- load_line_items if result.success?
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
- track_event('product_removed', { line_item: @line_item })
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 = current_store.products.active(current_currency).where.not(id: @product.id).
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 = current_store.products.active(current_currency).multi_search(query)
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
- taxon = @taxon || current_taxon
123
+ @default_products_finder_params ||= begin
124
+ taxon = @taxon || current_taxon
124
125
 
125
- filter = permitted_products_params.fetch(:filter, {}).dup
126
+ filter = permitted_products_params.fetch(:filter, {}).dup
126
127
 
127
- filter[:taxon_ids] ||= [taxon&.id.to_s].compact
128
- filter[:taxons] = filter[:taxon_ids].join(',')
128
+ filter[:taxon_ids] ||= [taxon&.id.to_s].compact
129
+ filter[:taxons] = filter[:taxon_ids].join(',')
129
130
 
130
- if filter.key?(:min_price) || filter.key?(:max_price)
131
- min_price = filter[:min_price].presence || 0
132
- max_price = filter[:max_price].presence || 'Infinity'
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
- filter[:price] = [min_price, max_price].compact.join(',')
135
- end
135
+ filter[:price] = [min_price, max_price].compact.join(',')
136
+ end
136
137
 
137
- permitted_products_params.merge(
138
- store: current_store,
139
- filter: filter,
140
- currency: current_currency
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
- Spree::OptionValue.for_products(storefront_products_for_filters).distinct
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?
@@ -38,8 +38,10 @@ module Spree
38
38
 
39
39
  return if fonts.blank?
40
40
 
41
+ font_weights = (200..700).step(100).to_a
42
+
41
43
  imports = fonts.map do |font|
42
- "family=#{font.split(' ').join('+')}:wght@200..700"
44
+ "family=#{font.split.join('+')}:wght@#{font_weights.join(';')}"
43
45
  end.compact.join('&')
44
46
 
45
47
  return if imports.blank?
@@ -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
@@ -53,6 +53,7 @@ module Spree
53
53
 
54
54
  def svg_country_icon(country_code)
55
55
  country_code = :us if country_code.to_s.downcase == 'en'
56
+ country_code = :jp if country_code.to_s.downcase == 'ja'
56
57
  tag.span(class: "fi fi-#{country_code.downcase}")
57
58
  end
58
59
 
@@ -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
  }
@@ -3,41 +3,48 @@ import { Controller } from "@hotwired/stimulus"
3
3
  export default class extends Controller {
4
4
  static targets = [ 'quantity', 'increase', 'decrease' ]
5
5
 
6
+ static values = {
7
+ min: { type: Number, default: 1 },
8
+ max: { type: Number, default: 9999 }
9
+ }
10
+
11
+ static classes = ['disabled']
12
+
6
13
  connect() {
7
- if (this.quantity <= 1) this.disableButton(this.decreaseTarget)
14
+ if (this.quantity <= this.minValue) this.disableButton(this.decreaseTarget)
8
15
  }
9
16
 
10
17
  get quantity() {
11
- return parseInt(this.quantityTarget.value) || 1
18
+ return parseInt(this.quantityTarget.value) || this.minValue
12
19
  }
13
20
 
14
21
  get maxQuantity() {
15
- return parseInt(this.quantityTarget.max) || 9999
22
+ return parseInt(this.quantityTarget.max) || this.maxValue
16
23
  }
17
24
 
18
25
  set quantity(value) {
19
- this.quantityTarget.value = parseInt(value) || 1
26
+ this.quantityTarget.value = parseInt(value) || this.minValue
20
27
  }
21
28
 
22
29
  increase() {
23
30
  if (this.quantity < this.maxQuantity) this.quantity = this.quantity + 1
24
- if (this.quantity > 1) this.enableButton(this.decreaseTarget)
31
+ if (this.quantity > this.minValue) this.enableButton(this.decreaseTarget)
25
32
  if (this.quantity == this.maxQuantity && this.increaseTarget.type != 'submit') this.disableButton(this.increaseTarget)
26
33
  }
27
34
 
28
35
  decrease() {
29
- if (this.quantity > 1) this.quantity = this.quantity - 1
30
- if (this.quantity == 1 && this.decreaseTarget.type != 'submit') this.disableButton(this.decreaseTarget)
36
+ if (this.quantity > this.minValue) this.quantity = this.quantity - 1
37
+ if (this.quantity == this.minValue && this.decreaseTarget.type != 'submit') this.disableButton(this.decreaseTarget)
31
38
  if (this.quantity < this.maxQuantity) this.enableButton(this.increaseTarget)
32
39
  }
33
40
 
34
41
  disableButton(button) {
35
42
  button.setAttribute('disabled', 'disabled')
36
- button.classList.add('opacity-50', 'cursor-not-allowed')
43
+ button.classList.add(...this.disabledClasses)
37
44
  }
38
45
 
39
46
  enableButton(button) {
40
47
  button.removeAttribute('disabled')
41
- button.classList.remove('opacity-50', 'cursor-not-allowed')
48
+ button.classList.remove(...this.disabledClasses)
42
49
  }
43
50
  }
@@ -6,6 +6,8 @@ export default class extends Controller {
6
6
  static targets = ['add', 'remove']
7
7
  static values = {
8
8
  variantId: String,
9
+ createWishlistPath: String,
10
+ destroyWishlistPath: String
9
11
  }
10
12
 
11
13
  connect() {
@@ -27,7 +29,7 @@ export default class extends Controller {
27
29
 
28
30
  const headers = {}
29
31
 
30
- const response = await post('/account/wishlist/wished_items', {
32
+ const response = await post(this.createWishlistPathValue, {
31
33
  body: body,
32
34
  headers: headers,
33
35
  responseKind: 'turbo-stream'
@@ -45,7 +47,7 @@ export default class extends Controller {
45
47
 
46
48
  const headers = {}
47
49
 
48
- const response = await destroy(`/account/wishlist/wished_items/${this.variantIdValue}`, {
50
+ const response = await destroy(this.destroyWishlistPathValue, {
49
51
  headers: headers,
50
52
  responseKind: 'turbo-stream'
51
53
  })
@@ -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>(<%= @minimum_password_length %> characters minimum)</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>(<%= @minimum_password_length %> characters minimum)</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 "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
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 "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
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 "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %>
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>
@@ -8,7 +8,7 @@
8
8
  <%= render 'spree/shared/head' %>
9
9
  <%= render 'spree/shared/custom_head' %>
10
10
  </head>
11
- <body id="checkout-page" class="w-full bg-background text-text">
11
+ <body id="checkout-page" class="theme-<%= current_theme.class.name.demodulize.underscore %> w-full bg-background text-text">
12
12
  <%= render_storefront_partials(:body_start_partials) %>
13
13
  <%= current_store.storefront_custom_code_body_start&.html_safe %>
14
14
 
@@ -6,7 +6,7 @@
6
6
  <%= render 'spree/shared/json_ld' %>
7
7
  <%= current_store.storefront_custom_code_head&.html_safe %>
8
8
  </head>
9
- <body class="bg-background w-full text-text <%= current_page&.slug %>-page <% if current_theme_preview.present? %>inside-page-builder<% end %>">
9
+ <body class="theme-<%= current_theme.class.name.demodulize.underscore %> bg-background w-full text-text <%= current_page&.slug %>-page <% if current_theme_preview.present? %>inside-page-builder<% end %>">
10
10
  <%= render_storefront_partials(:body_start_partials) %>
11
11
  <%= current_store.storefront_custom_code_body_start&.html_safe %>
12
12
 
@@ -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
- Set as default delivery address
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
- Set as default billing address
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
- </label>
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
- It seems you already have an account with us. Please
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 'Apply', class: 'min-h-full ml-3 btn-primary !px-4 !py-3', data: { 'enable-button-target': 'button' }, disabled: true %>
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
- Some products in your cart will be dispatched a bit later than the rest of your order:
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 'Return to cart', spree.cart_path, class: 'mx-4 py-4', target: :_top %>
11
- <%= link_to '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 %>
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>
@@ -66,7 +66,7 @@
66
66
  class="btn-primary w-full lg:w-2/5 font-semibold checkout-content-save-continue-button my-5 !py-4"
67
67
  >
68
68
  <%= render 'button_processing', is_hidden: true %>
69
- <%= Spree.t(:pay).titleize %>
69
+ <%= Spree.t(:pay) %>
70
70
  </button>
71
71
  </div>
72
72
  <% end %>
@@ -47,70 +47,71 @@
47
47
  <span>
48
48
  <%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
49
49
  </span>
50
- <% end %>
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
- <% if order.payment? || order.completed? %>
61
- <% cache spree_base_cache_scope.call(order.all_adjustments.nonzero.tax.eligible.cache_key_with_version) do %>
62
- <% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
63
- <div class="flex justify-between items-center mb-2">
64
- <span><%= label %></span>
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
- <% tax_total = Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
67
- <span><%= tax_total.to_html %></span>
68
- </div>
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
- <% if order.adjustments.nonzero.non_tax.eligible.exists? %>
74
- <% order.adjustments.nonzero.non_tax.eligible.each do |adjustment| %>
75
- <div class="flex justify-between items-center mb-2">
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
- <span>
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
- <div>
99
- <div class="flex justify-between items-center">
100
- <span class="font-bold text-lg"><%= Spree.t(:total) %></span>
101
- <div class="">
102
- <span class="text-xs mr-1"><%= order.currency.upcase %></span>
103
- <span class="font-semibold text-lg inline" id='summary-order-total' data-currency="<%= Money::Currency.find(order.currency).symbol %>">
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
- <% end %>
116
+ </div>
117
+ <% end %>