spree_storefront 5.1.0.beta4 → 5.1.0.rc1

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -1
  3. data/app/controllers/spree/account/gift_cards_controller.rb +15 -0
  4. data/app/controllers/spree/checkout_controller.rb +12 -6
  5. data/app/controllers/spree/line_items_controller.rb +14 -7
  6. data/app/controllers/spree/products_controller.rb +1 -1
  7. data/app/controllers/spree/search_controller.rb +1 -1
  8. data/app/controllers/spree/store_controller.rb +2 -2
  9. data/app/helpers/spree/cart_helper.rb +1 -1
  10. data/app/helpers/spree/checkout_helper.rb +1 -2
  11. data/app/helpers/spree/filters_helper.rb +29 -21
  12. data/app/helpers/spree/products_helper.rb +5 -1
  13. data/app/helpers/spree/storefront_helper.rb +6 -3
  14. data/app/javascript/spree/storefront/controllers/card_validation_controller.js +2 -0
  15. data/app/javascript/spree/storefront/controllers/cart_controller.js +5 -0
  16. data/app/views/devise/passwords/edit.html.erb +1 -1
  17. data/app/views/devise/registrations/new.html.erb +1 -1
  18. data/app/views/devise/shared/_links.html.erb +3 -3
  19. data/app/views/spree/addresses/edit.html.erb +2 -2
  20. data/app/views/spree/checkout/_address.html.erb +25 -38
  21. data/app/views/spree/checkout/_address_list_item.html.erb +14 -0
  22. data/app/views/spree/checkout/_coupon_code.html.erb +3 -3
  23. data/app/views/spree/checkout/_delivery.html.erb +3 -36
  24. data/app/views/spree/checkout/_delivery_backorder_notice.html.erb +10 -0
  25. data/app/views/spree/checkout/_delivery_shipping_rate.html.erb +22 -0
  26. data/app/views/spree/checkout/_line_item.html.erb +1 -1
  27. data/app/views/spree/checkout/_missing_all_line_items.html.erb +2 -2
  28. data/app/views/spree/checkout/_order_lock_version.html.erb +3 -0
  29. data/app/views/spree/checkout/_payment.html.erb +11 -9
  30. data/app/views/spree/checkout/_payment_methods.html.erb +1 -1
  31. data/app/views/spree/checkout/_store_credit.html.erb +1 -1
  32. data/app/views/spree/checkout/_summary.html.erb +1 -1
  33. data/app/views/spree/checkout/payment/_gateway.html.erb +12 -12
  34. data/app/views/spree/checkout/payment/_store_credit.html.erb +2 -2
  35. data/app/views/spree/checkout/update.turbo_stream.erb +1 -3
  36. data/app/views/spree/line_items/destroy.turbo_stream.erb +14 -10
  37. data/app/views/spree/seo/sitemap.xml.erb +2 -2
  38. data/app/views/themes/default/spree/account/_order.html.erb +5 -5
  39. data/app/views/themes/default/spree/account/gift_cards/_gift_card.html.erb +26 -0
  40. data/app/views/themes/default/spree/account/gift_cards/index.html.erb +30 -0
  41. data/app/views/themes/default/spree/checkout/complete.html.erb +1 -1
  42. data/app/views/themes/default/spree/orders/_line_item.html.erb +3 -3
  43. data/app/views/themes/default/spree/page_sections/_featured_posts.html.erb +56 -0
  44. data/app/views/themes/default/spree/page_sections/_featured_product.html.erb +1 -1
  45. data/app/views/themes/default/spree/page_sections/_featured_taxon.html.erb +2 -2
  46. data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +4 -5
  47. data/app/views/themes/default/spree/policies/show.html.erb +11 -7
  48. data/app/views/themes/default/spree/posts/_post.html.erb +20 -11
  49. data/app/views/themes/default/spree/products/_add_to_cart_button.html.erb +4 -4
  50. data/app/views/themes/default/spree/products/_details.html.erb +1 -1
  51. data/app/views/themes/default/spree/products/_json_ld.html.erb +1 -1
  52. data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +1 -1
  53. data/app/views/themes/default/spree/products/_media_gallery.html.erb +1 -2
  54. data/app/views/themes/default/spree/products/filters/_availability.html.erb +1 -1
  55. data/app/views/themes/default/spree/products/filters/_price.html.erb +4 -4
  56. data/app/views/themes/default/spree/products/filters/_taxons.erb +1 -1
  57. data/app/views/themes/default/spree/shared/_cart_icon.html.erb +4 -2
  58. data/app/views/themes/default/spree/shared/_cart_pane.html.erb +5 -2
  59. data/app/views/themes/default/spree/shared/_meta_tags.html.erb +2 -2
  60. data/app/views/themes/default/spree/shared/_order_shipment.html.erb +11 -12
  61. data/app/views/themes/default/spree/shared/icons/_discord.html.erb +9 -0
  62. data/config/locales/en.yml +10 -1
  63. data/config/routes.rb +1 -0
  64. data/lib/generators/spree/storefront/theme/templates/model.rb.tt +91 -4
  65. data/lib/spree/storefront/testing_support/cart_utils.rb +30 -0
  66. metadata +16 -6
@@ -0,0 +1,22 @@
1
+ <li class="list-group-item p-0 m-0 border-b delivery-list-item border-default" data-checkout-delivery-target="shippingRate" id="<%= spree_dom_id(rate) %>">
2
+ <div class="custom-control custom-radio flex items-center px-5 py-4">
3
+ <%= ship_form.radio_button :selected_shipping_rate_id,
4
+ rate.id,
5
+ class: 'custom-control-input radio-input',
6
+ id: "shipping-rate-#{rate.id}",
7
+ data: {
8
+ action: 'click->checkout-delivery#update',
9
+ cost: rate.display_cost,
10
+ tax: rate.display_tax_amount
11
+ } %>
12
+ <label class="select-none cursor-pointer px-2 word-break w-full" for="<%= "shipping-rate-#{rate.id}" %>">
13
+ <%= rate.name %>
14
+ <% if rate.delivery_range %>
15
+ <span class="text-gray-600 text-xs ml-3"><%= rate.display_delivery_range %></span>
16
+ <% end %>
17
+ </label>
18
+ <span class="text-right">
19
+ <%= rate.cost <= 0 ? Spree.t(:free) : rate.display_cost %>
20
+ </span>
21
+ </div>
22
+ </li>
@@ -15,7 +15,7 @@
15
15
  <div class="font-semibold text-sm text-right shrink-0">
16
16
  <% if should_display_compare_at_price?(line_item.variant) %>
17
17
  <span class="line-through text-red-500">
18
- <%= Spree::Money.new(line_item.variant.compare_at_amount_in(line_item.currency) * line_item.quantity, currency: line_item.currency) %>
18
+ <%= line_item.display_compare_at_amount %>
19
19
  </span>
20
20
  <br />
21
21
  <% end %>
@@ -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>
@@ -0,0 +1,3 @@
1
+ <%= turbo_frame_tag :checkout_lock_version do %>
2
+ <%= hidden_field_tag 'order[state_lock_version]', order.state_lock_version %>
3
+ <% end %>
@@ -1,23 +1,25 @@
1
1
  <%= form_for @order, url: spree.update_checkout_path(@order.token, @order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
2
- <%= form.hidden_field :state_lock_version %>
3
-
2
+ <%= render 'spree/checkout/order_lock_version', order: @order %>
3
+
4
4
  <% if @order.respond_to?(:gift_card) %>
5
5
  <%= turbo_frame_tag :gift_card_code_field do %>
6
6
  <%= hidden_field_tag 'order[gift_card_code]', @order.gift_card&.code %>
7
7
  <%= hidden_field_tag 'order[gift_card_amount]', @order.gift_card_total %>
8
8
  <% end %>
9
9
  <% end %>
10
-
11
- <% use_shipping = @order.shipping_eq_billing_address? || @order.bill_address.nil? || @order.bill_address.new_record? %>
12
-
10
+
11
+ <% use_shipping = (@order.shipping_eq_billing_address? || @order.bill_address.nil? || @order.bill_address.new_record?) && @order.requires_ship_address? %>
12
+
13
13
  <div id="billing-address" class="mb-8 max-w-full" data-controller="toggle">
14
14
  <h5 class="mb-3 font-body font-semibold">
15
15
  <%= Spree.t(:billing_address) %>
16
16
  </h5>
17
- <div class="flex items-center">
18
- <%= form.check_box :use_shipping, { checked: use_shipping, class: 'checkbox-input', data: { action: 'change->toggle#toggle' } } %>
19
- <%= form.label :use_shipping, Spree.t(:use_shipping_address), class: 'ml-1 cursor-pointer select-none' %>
20
- </div>
17
+ <% if @order.requires_ship_address? %>
18
+ <div class="flex items-center">
19
+ <%= form.check_box :use_shipping, { checked: use_shipping, class: 'checkbox-input', data: { action: 'change->toggle#toggle' } } %>
20
+ <%= form.label :use_shipping, Spree.t(:use_shipping_address), class: 'ml-1 cursor-pointer select-none' %>
21
+ </div>
22
+ <% end %>
21
23
  <%= form.fields_for :bill_address do |address_form| %>
22
24
  <div class="mt-4 <%= 'hidden' if use_shipping %>" data-toggle-target='toggleable'>
23
25
  <%= render partial: 'spree/addresses/form', locals: {
@@ -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 %>
@@ -11,7 +11,7 @@
11
11
  <%= check_box_tag :store_credit, '1', @order.using_store_credit?,
12
12
  class: 'input-checkbox !border-neutral-200 rounded-md',
13
13
  data: { action: 'auto-submit#submit' } %>
14
- <%= Spree.t("store_credit.apply") %>
14
+ <%= Spree.t(:apply_store_credit) %>
15
15
  <% end %>
16
16
 
17
17
  <div><%= @order.display_total_available_store_credit %></div>
@@ -91,7 +91,7 @@
91
91
  </div>
92
92
  <% elsif order.using_store_credit? %>
93
93
  <div class="flex justify-between items-center mb-2">
94
- <span>Store credit:</span>
94
+ <span><%= Spree.t(:store_credit_name) %>:</span>
95
95
  <span><%= order.display_total_applied_store_credit %></span>
96
96
  </div>
97
97
  <% 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: "MM/YYYY",
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| %>
@@ -2,12 +2,12 @@
2
2
  <div class="d-flex flex-column mb-5" data-hook="checkout_payment_store_credit_success">
3
3
  <p class="store-credit-title font-body">
4
4
  <% if @order.respond_to?(:gift_card) && @order.gift_card.present? %>
5
- <%= Spree.t('storefront.checkout.gift_card_amount_applied', amount: @order.display_gift_card_total, code: @order.gift_card.code) %>
5
+ <%= Spree.t('storefront.checkout.gift_card_amount_applied', amount: @order.display_gift_card_total, code: @order.gift_card.code.upcase) %>
6
6
  <% else %>
7
7
  <%= Spree.t('storefront.checkout.store_credits_amount_applied', amount: @order.display_total_applicable_store_credit.abs) %>
8
8
  <% end %>
9
9
 
10
- <%= Spree.t('storefront.checkout.you_will_need_to_pay_only', amount: @order.display_total_minus_store_credits) %>
10
+ <%= Spree.t('storefront.checkout.you_will_need_to_pay_only', amount: @order.display_total_minus_store_credits) if @order.total_minus_store_credits.positive? %>
11
11
  </p>
12
12
  </div>
13
13
  <% end %>
@@ -2,9 +2,7 @@
2
2
  <%= render 'summary', order: @order %>
3
3
  <% end %>
4
4
  <%= turbo_stream.replace :checkout_lock_version do %>
5
- <%= turbo_frame_tag :checkout_lock_version do %>
6
- <%= hidden_field_tag 'order[state_lock_version]', @order.state_lock_version %>
7
- <% end %>
5
+ <%= render 'spree/checkout/order_lock_version', order: @order %>
8
6
  <% end %>
9
7
  <%= turbo_stream.update 'summary-order-total' do %>
10
8
  <%= @order.display_total.to_html %>
@@ -1,13 +1,17 @@
1
- <%= turbo_stream.replace_all '.cart-contents' do %>
2
- <%= turbo_frame_tag cart_id(@order), class: 'cart-contents' do %>
3
- <% if @order.line_items.empty? %>
4
- <%= render 'spree/orders/empty' %>
5
- <% else %>
6
- <%= render 'spree/orders/cart' %>
7
- <% end %>
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 %>
8
11
 
9
- <%= render_storefront_partials(:remove_from_cart_partials) %>
12
+ <%= render_storefront_partials(:remove_from_cart_partials) %>
13
+ <% end %>
10
14
  <% end %>
11
- <% end %>
12
15
 
13
- <%= 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 [current_store.products, current_currency] do %>
16
- <% current_store.products.active(current_currency).find_each do |product| %>
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>
@@ -8,16 +8,16 @@
8
8
  <% if order.payment_state == 'void' %>
9
9
  <% if order.order_refunded? %>
10
10
  <span class="badge-refunded">
11
- <%= Spree.t("payment_states.refunded").titleize %>
11
+ <%= Spree.t("payment_states.refunded") %>
12
12
  </span>
13
13
  <% else %>
14
14
  <span class="badge-void">
15
- <%= Spree.t("payment_states.#{order.payment_state}").titleize %>
15
+ <%= Spree.t("payment_states.#{order.payment_state}") %>
16
16
  </span>
17
17
  <% end %>
18
18
  <% else %>
19
19
  <span class="badge-success">
20
- <%= Spree.t("payment_states.#{order.payment_state}").titleize %>
20
+ <%= Spree.t("payment_states.#{order.payment_state}") %>
21
21
  </span>
22
22
  <% end %>
23
23
  <% end %>
@@ -26,11 +26,11 @@
26
26
  <% if order.shipment_state %>
27
27
  <% if order.shipment_state == 'shipped' %>
28
28
  <span class="badge-success">
29
- <%= Spree.t("shipment_states.#{order.shipment_state}").titleize %>
29
+ <%= Spree.t("shipment_states.#{order.shipment_state}") %>
30
30
  </span>
31
31
  <% else %>
32
32
  <span class="badge-<%= order.shipment_state %>">
33
- <%= Spree.t("shipment_states.#{order.shipment_state}").titleize %>
33
+ <%= Spree.t("shipment_states.#{order.shipment_state}") %>
34
34
  </span>
35
35
  <% end %>
36
36
  <% end %>
@@ -0,0 +1,26 @@
1
+ <tr class="flex flex-wrap w-full md:table-row md:h-[72px] border border-accent md:border-none mb-4 p-4 md:p-0 hover:bg-accent-100" id="<%= dom_id(gift_card) %>">
2
+ <td class="mb-4 w-full md:w-auto md:px-4 md:border-y border-accent md:border-l font-medium">
3
+ <%= gift_card.code.upcase %>
4
+ </td>
5
+
6
+ <td class="mb-4 w-full md:w-auto md:px-4 md:border-y border-accent">
7
+ <span class="<%= gift_card.active? ? 'badge-active' : 'badge-inactive'%>">
8
+ <%= gift_card.display_state.titleize %>
9
+ </span>
10
+ </td>
11
+
12
+ <td class="w-full md:w-auto md:px-4 md:border-y border-accent">
13
+ <span class="md:hidden font-medium mr-1"><%= Spree.t(:amount) %>:</span>
14
+ <%= gift_card.display_amount %>
15
+ </td>
16
+
17
+ <td class="w-full md:w-auto md:px-4 md:border-y border-accent">
18
+ <span class="md:hidden font-medium mr-1"><%= Spree.t(:used) %>:</span>
19
+ <%= gift_card.display_amount_used %>
20
+ </td>
21
+
22
+ <td class="w-full md:w-auto md:px-4 md:border-y md:border-r border-accent">
23
+ <span class="md:hidden font-medium mr-1"><%= Spree.t(:expires_at) %>:</span>
24
+ <%= gift_card.expires_at.present? ? local_date(gift_card.expires_at) : '-' %>
25
+ </td>
26
+ </tr>
@@ -0,0 +1,30 @@
1
+ <div class="page-container grid grid-cols-1 lg:grid-cols-12 lg:gap-6 lg:mt-6">
2
+ <div class="lg:col-span-3">
3
+ <%= render 'spree/account/account_nav', current: 'gift_cards' %>
4
+ </div>
5
+ <div class="lg:col-span-8 lg:col-start-5">
6
+ <h1 class="font-medium mb-4">
7
+ <%= Spree.t(:gift_cards) %>
8
+ </h1>
9
+ <% if @gift_cards.any? %>
10
+ <table class="inline-table md:table table-auto overflow-scroll w-full text-sm border-separate border-spacing-y-4 mb-24 mt-4">
11
+ <thead class="hidden md:table-row-group">
12
+ <tr class="text-left text-neutral text-xs">
13
+ <th class="font-normal px-4"><%= Spree.t(:code) %></th>
14
+ <th class="font-normal px-4"><%= Spree.t(:status) %></th>
15
+ <th class="font-normal px-4"><%= Spree.t(:amount) %></th>
16
+ <th class="font-normal px-4"><%= Spree.t(:used) %></th>
17
+ <th class="font-normal px-4"><%= Spree.t(:expires_at) %></th>
18
+ </tr>
19
+ </thead>
20
+ <tbody class="block md:table-row-group">
21
+ <%= render collection: @gift_cards, partial: 'spree/account/gift_cards/gift_card', cached: spree_base_cache_scope %>
22
+ </tbody>
23
+ </table>
24
+ <% else %>
25
+ <div class="text-center my-16 lg:my14">
26
+ <p class="mb-2 font-medium uppercase"><%= Spree.t('storefront.account.no_gift_cards') %></p>
27
+ </div>
28
+ <% end %>
29
+ </div>
30
+ </div>
@@ -24,7 +24,7 @@
24
24
  <div class="mt-3 border-t pt-3">
25
25
  <span class="text-sm"><%= Spree.t(:status) %></span>
26
26
  <% if @order.payment_state.present? %>
27
- <span class="badge-<%= @order.payment_state %>"><%= Spree.t("payment_states.#{@order.payment_state}").titleize %></span>
27
+ <span class="badge-<%= @order.payment_state %>"><%= Spree.t("payment_states.#{@order.payment_state}") %></span>
28
28
  <% else %>
29
29
  <span class="badge-pending"><%= Spree.t(:pending) %></span>
30
30
  <% end %>
@@ -1,5 +1,5 @@
1
- <%= turbo_frame_tag dom_id(line_item), data: { controller: 'reveal' } do %>
2
- <li class="cart-line-item flex items-top py-6 px-4 w-full" data-reveal-target="item">
1
+ <%= turbo_frame_tag dom_id(line_item) do %>
2
+ <li class="cart-line-item flex items-top py-6 px-4 w-full">
3
3
  <div class="line-item-overlay"></div>
4
4
  <div class="cart-product-image flex-shrink-0" id="<%= dom_id(line_item) %>-image" data-turbo-permanent>
5
5
  <% image = line_item.variant.default_image %>
@@ -14,7 +14,7 @@
14
14
  <%= link_to line_item.name, spree_storefront_resource_url(line_item.product), class: 'font-semibold text-text', data: { 'turbo-frame': '_top' } %>
15
15
 
16
16
  <%= form_for line_item, url: spree.line_item_url(line_item, order_token: line_item.order.token), method: :delete, data: { controller: 'turbo-stream-form' } do |item_form| %>
17
- <%= button_tag type: :submit, class: 'remove-line-item-button h-100', data: { action: "click->reveal#hide click->cart#disableCart" } do %>
17
+ <%= button_tag type: :submit, class: 'remove-line-item-button h-100', data: { action: "click->cart#disableCart turbo-stream-form:submit-end->cart#enableCart" } do %>
18
18
  <%= render 'spree/shared/icons/cross', size: 16 %>
19
19
  <% end %>
20
20
  <% end %>
@@ -0,0 +1,56 @@
1
+ <div style='<%= section_styles(section) %>' class='animate-fadeIn'>
2
+ <div class='page-container'>
3
+ <% heading_size =
4
+ case section.preferred_heading_size
5
+ when "small"
6
+ "text-base font-medium"
7
+ when "medium"
8
+ "text-lg lg:text-xl font-medium"
9
+ when "large"
10
+ "text-xl lg:text-2xl font-medium"
11
+ end %>
12
+ <% if section.preferred_heading.present? %>
13
+ <div class='mb-8 flex flex-col'>
14
+ <h3
15
+ class='
16
+ <%= heading_size %> featured-taxon--title font-medium
17
+ text-<%= section.preferred_heading_alignment %>
18
+ '
19
+ data-title="<%= section.preferred_heading.downcase %>"
20
+ style='<%= section_heading_styles(section) %>'
21
+ >
22
+ <%= section.preferred_heading %>
23
+ </h3>
24
+
25
+ <% if section.description.present? %>
26
+ <div class='pt-4 text-<%= section.preferred_description_alignment %>'>
27
+ <%= section.description %>
28
+ </div>
29
+ <% end %>
30
+ </div>
31
+ <% end %>
32
+ <div class='flex h-full relative'>
33
+ <div
34
+ class='
35
+ swiper-container overflow-hidden flex-1 pr-8 lg:pr-0 -mx-4 lg:mx-0 flex flex-col
36
+ lg:flex-col-reverse
37
+ '
38
+ data-controller='carousel'
39
+ data-carousel-options-value='{ "slidesPerView": 1, "centeredSlides": false, "spaceBetween": 16, "grabCursor": true, "breakpoints": { "768": { "slidesPerView": 3, "spaceBetween": 24 } }, "navigation": { "nextEl": ".swiper-custom-button-next-<%= section.id %>", "prevEl": ".swiper-custom-button-prev-<%= section.id %>" } }'
40
+ >
41
+ <div class='swiper-wrapper px-4 lg:px-0 h-auto'>
42
+ <%= render partial: "spree/posts/post",
43
+ collection: section.posts,
44
+ cached: spree_base_cache_scope,
45
+ as: :post %>
46
+ </div>
47
+ <%= button_tag class: "absolute p-2 bg-white rounded-full z-10 border border-accent left-0 disabled:hidden hover:border-primary ml-2 lg:ml-0 swiper-custom-button-prev-#{section.id} block top-[100px]", aria: { label: "Previous posts" }, style: "transform: translate(-50%, -50%);" do %>
48
+ <%= render "spree/shared/icons/chevron" %>
49
+ <% end %>
50
+ <%= button_tag class: "absolute p-2 bg-white rounded-full z-10 border border-accent right-0 disabled:hidden hover:border-primary mr-2 lg:mr-0 swiper-custom-button-next-#{section.id} block top-[100px]", aria: { label: "Next posts" }, style: "transform: translate(50%, -50%);" do %>
51
+ <%= render "spree/shared/icons/chevron_right" %>
52
+ <% end %>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
@@ -89,7 +89,7 @@
89
89
  <% if presenter.product %>
90
90
  <div class="absolute flex" data-controller="copy-input">
91
91
  <div class="has-float-label flex flex-col max-w-[200px]">
92
- <%= text_field_tag "product-#{presenter.product.id}-share-link", spree.product_url(presenter.product, host: current_store.url), class: 'text-ellipsis text-input border-r-0 !rounded-r-none !rounded-l-md', readonly: true, type: 'text', onclick: 'this.select()', data: { copy_input_target: 'input' } %>
92
+ <%= text_field_tag "product-#{presenter.product.id}-share-link", spree.product_url(presenter.product, host: current_store.url_or_custom_domain), class: 'text-ellipsis text-input border-r-0 !rounded-r-none !rounded-l-md', readonly: true, type: 'text', onclick: 'this.select()', data: { copy_input_target: 'input' } %>
93
93
  <%= label_tag "product-#{presenter.product.id}-share-link", Spree.t(:link) %>
94
94
  </div>
95
95
  <button
@@ -5,7 +5,7 @@
5
5
  when 'medium' then 'text-lg lg:text-xl font-medium'
6
6
  when 'large' then 'text-xl lg:text-2xl font-medium'
7
7
  end %>
8
- <% if section.taxon&.image&.attached? && section.preferred_show_taxon_image %>
8
+ <% if section.taxon&.page_builder_image&.attached? && section.preferred_show_taxon_image %>
9
9
  <% desktop_slides_amount = 2.5 %>
10
10
  <% section_with_image = true %>
11
11
  <% arrows_on_top = false %>
@@ -47,7 +47,7 @@
47
47
  <% if section_with_image %>
48
48
  <div class='lg:col-span-5'>
49
49
  <%= link_to spree.nested_taxons_path(section.taxon), data: { turbo_frame: "_top" } do %>
50
- <%= spree_image_tag(section.taxon.image, height: 500, width: 500, class: 'h-full w-full object-cover object-center', loading: :lazy) %>
50
+ <%= spree_image_tag(section.taxon.page_builder_image, height: 500, width: 500, class: 'h-full w-full object-cover object-center', loading: :lazy) %>
51
51
  <% end %>
52
52
  </div>
53
53
  <% end %>
@@ -12,9 +12,9 @@
12
12
  <div class="gap-6 grid-cols-2 sm:grid-cols-4 lg:grid-cols-6 xl:gap-x-8 mb-7 hidden md:grid">
13
13
  <% section.links.each do |link| %>
14
14
  <%= page_builder_link_to link, title: link.label, class: 'group block overflow-hidden', target: link.open_in_new_tab.presence && '_blank' do %>
15
- <% if link.linkable.image&.attached? && link.linkable.image&.variable? %>
15
+ <% if link.linkable.page_builder_image&.attached? && link.linkable.page_builder_image&.variable? %>
16
16
  <div class="flex space-y-2 flex-col">
17
- <%= spree_image_tag(link.linkable.image, height: 300, width: 300, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
17
+ <%= spree_image_tag(link.linkable.page_builder_image, height: 300, width: 300, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
18
18
  <span><%= link.label %></span>
19
19
  </div>
20
20
  <% else %>
@@ -47,10 +47,9 @@
47
47
  <% section.links.each do |link| %>
48
48
  <div class='swiper-slide w-[200px]'>
49
49
  <%= page_builder_link_to link, title: link.label, class: 'group block overflow-hidden', target: link.open_in_new_tab.presence && '_blank' do %>
50
- <% if link.linkable.image&.attached? && link.linkable.image&.variable? %>
50
+ <% if link.linkable.page_builder_image.attached? %>
51
51
  <div class="flex space-y-2 flex-col">
52
- <%= spree_image_tag(link.linkable.image, height: 200, width: 200, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
53
- <span><%= link.label %></span>
52
+ <%= spree_image_tag(link.linkable.page_builder_image, height: 200, width: 200, class: 'h-full w-full object-cover object-center group-hover:opacity-75 rounded-md bg-gray-200', loading: :lazy, alt: link.label) %>
54
53
  </div>
55
54
  <% else %>
56
55
  <div class="aspect-1 w-full group-hover:bg-gray-100 bg-gray-200 flex items-center justify-center relative">
@@ -1,11 +1,15 @@
1
1
  <div class="page-container py-12">
2
2
  <h1 class="text-2xl tracking-tight text-center lg:text-left mb-3 uppercase">
3
- <%= params[:id].titleize %>
3
+ <%= Spree.t(params[:id]) %>
4
4
  </h1>
5
- <p class="mb-8 text-center lg:text-left">
6
- Last update: <%= @policy&.updated_at&.strftime('%d/%m/%Y') %>
7
- </p>
8
- <div class="mb-5">
9
- <%= @policy&.to_s %>
10
- </div>
5
+
6
+ <% if @policy.present? %>
7
+ <p class="mb-8 text-center lg:text-left">
8
+ <%= Spree.t("storefront.policies.last_update_at", date: l(@policy.updated_at.to_date)) %>
9
+ </p>
10
+
11
+ <div class="mb-5">
12
+ <%= @policy&.to_s %>
13
+ </div>
14
+ <% end %>
11
15
  </div>
@@ -1,13 +1,22 @@
1
- <div id="<%= dom_id(post) %>">
2
- <%= link_to spree.post_path(post), class: 'block hover:opacity-70 transition-opacity' do %>
3
- <div class="h-[200px] w-full bg-gray-100">
4
- <% if post.image.attached? && post.image.variable? %>
5
- <%= spree_image_tag(post.image, width: 400, height: 200, class: 'h-full w-full object-cover object-center', loading: :lazy, alt: post.title) %>
6
- <% end %>
7
- </div>
1
+ <div class="swiper-slide w-full">
2
+ <div id="<%= dom_id(post) %>">
3
+ <%= link_to spree.post_path(post), class: 'block hover:opacity-70 transition-opacity', data: { turbo_frame: '_top' } do %>
4
+ <div class="h-[200px] w-full bg-gray-100">
5
+ <% if post.image.attached? && post.image.variable? %>
6
+ <%= spree_image_tag(
7
+ post.image,
8
+ width: 400,
9
+ height: 200,
10
+ class: "h-full w-full object-cover object-center",
11
+ loading: :lazy,
12
+ alt: post.title,
13
+ ) %>
14
+ <% end %>
15
+ </div>
8
16
 
9
- <h1 class="uppercase text-lg font-medium mt-4"><%= post.title %></h1>
10
- <div class="mt-2 text-sm"><%= local_time(post.published_at, '%B %e, %Y') %></div>
11
- <div class="mt-4"><%= post.shortened_description %></div>
12
- <% end %>
17
+ <h1 class="uppercase text-lg font-medium mt-4"><%= post.title %></h1>
18
+ <div class="mt-2 text-sm"><%= local_time(post.published_at, "%B %e, %Y") %></div>
19
+ <div class="mt-4"><%= post.shortened_description %></div>
20
+ <% end %>
21
+ </div>
13
22
  </div>
@@ -24,9 +24,9 @@ variant_not_available = selected_variant.nil? ||
24
24
  },
25
25
  disabled: product.price_in(current_currency).zero? do %>
26
26
  <% if not_selected_options.size == 1 %>
27
- <span><%= Spree.t(:please_select, option: not_selected_options[0].presentation) %></span>
27
+ <span><%= Spree.t('storefront.variant_picker.please_choose', option_type: not_selected_options[0].presentation) %></span>
28
28
  <% elsif not_all_options_selected %>
29
- <span><%= Spree.t(:please_select_all_options) %></span>
29
+ <span><%= Spree.t('storefront.variant_picker.please_choose_all_options') %></span>
30
30
  <% elsif variant_not_available %>
31
31
  <span><%= Spree.t(:notify_me_when_available) %></span>
32
32
  <%= render 'spree/shared/icons/bell' %>
@@ -49,9 +49,9 @@ variant_not_available = selected_variant.nil? ||
49
49
  },
50
50
  disabled: product.price_in(current_currency).zero? do %>
51
51
  <% if not_selected_options.size == 1 %>
52
- <span><%= Spree.t(:please_select, option: not_selected_options[0].presentation) %></span>
52
+ <span><%= Spree.t('storefront.variant_picker.please_choose', option_type: not_selected_options[0].presentation) %></span>
53
53
  <% elsif not_all_options_selected %>
54
- <span><%= Spree.t(:please_select_all_options) %></span>
54
+ <span><%= Spree.t('storefront.variant_picker.please_choose_all_options') %></span>
55
55
  <% elsif variant_not_available %>
56
56
  <span><%= Spree.t(:notify_me_when_available) %></span>
57
57
  <%= render 'spree/shared/icons/bell' %>
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  <% end %>
41
41
 
42
- <% product.product_properties.joins(:property).merge(Spree::Property.available_on_front_end).sort_by_property_position.each do |product_property| %>
42
+ <% product_properties(product).each do |product_property| %>
43
43
  <div class="product-property py-4 border-b border-default">
44
44
 
45
45
  <%= link_to "#property_#{product_property.id}", class: 'text-sm uppercase tracking-widest inline-flex w-full justify-between !border-b-transparent', data: { action: 'accordion#toggle' } do %>
@@ -4,7 +4,7 @@
4
4
  "@context": "https://schema.org/",
5
5
  "@type": "Product",
6
6
  "name": <%= product.name.to_json.html_safe %>,
7
- "url": <%= spree.product_url(product).to_json.html_safe %>,
7
+ "url": <%= spree.product_url(product, host: current_store.url_or_custom_domain).to_json.html_safe %>,
8
8
  <% if product.featured_image %>
9
9
  "image": [
10
10
  <%= spree_image_url(product.featured_image, width: 630, height: 630).to_json.html_safe %>
@@ -6,5 +6,5 @@
6
6
  "availability": "http://schema.org/<%= variant.available? ? 'InStock' : 'OutOfStock' %>",
7
7
  "price": <%= variant.amount_in(current_currency).to_json.html_safe %>,
8
8
  "priceCurrency": <%= current_currency.to_json.html_safe %>,
9
- "url": <%= spree.product_url(product, variant_id: variant.id).to_json.html_safe %>
9
+ "url": <%= spree.product_url(product, variant_id: variant.id, host: current_store.url_or_custom_domain).to_json.html_safe %>
10
10
  }
@@ -85,8 +85,7 @@
85
85
  <div id='pinch-to-zoom' class='fixed top-0 left-0 p-4 bg-background z-50 flex justify-center items-center flex-col'>
86
86
  <div class='w-14 h-14'><%= render 'spree/shared/icons/pinch' %></div>
87
87
  <div class='text-sm uppercase pt-4 px-5 text-center !leading-tight'>
88
- Pinch to <br>
89
- zoom
88
+ <%= Spree.t("storefront.products.pinch_to_zoom_html") %>
90
89
  </div>
91
90
  </div>
92
91
  <% end %>