Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed checkout translation issues

Damian Legawiec62fffdbfd6a9
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index c415a393bd..181814fc05 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -676,22 +676,10 @@ en:
cart_state_changed: Cart changed
categories: Categories
category: Category
- category_nav_bar:
- get_up_to_30_percent_off: GET UP TO 30% OFF
- jackets_and_coats: JACKET & COASTS
- new_collection: NEW COLLECTION
- special_offers: SPECIAL OFFERS
changes_published: Changes published!
channel: Channel
charged: Charged
checkout: Checkout
- checkout_page:
- main_navigation: Main navigation
- checkout_navigation: Checkout navigation
- back_to_cart: back to cart
- delivery_method: delivery method
- header: Checkout
- product: Product
choose_a_customer: Choose a customer
choose_a_taxon_to_sort_products_for: "Choose a taxon to sort products for"
choose_currency: Choose Currency
diff --git a/storefront/app/views/spree/checkout/_delivery.html.erb b/storefront/app/views/spree/checkout/_delivery.html.erb
index 3ee188726d..fc00f6fc3f 100644
--- a/storefront/app/views/spree/checkout/_delivery.html.erb
+++ b/storefront/app/views/spree/checkout/_delivery.html.erb
@@ -19,7 +19,7 @@
<%= form.fields_for :shipments do |ship_form| %>
<div class="shipment">
<h5 class="checkout-content-header mb-3 font-body">
- <%= Spree.t('checkout_page.delivery_method').capitalize %>
+ <%= Spree.t('storefront.checkout.delivery_method').capitalize %>
<% if ship_form.object.stock_location.present? %>
<%= Spree.t(:from).downcase %>
<strong><%= ship_form.object.stock_location.name %></strong>
diff --git a/storefront/app/views/spree/checkout/_line_items.html.erb b/storefront/app/views/spree/checkout/_line_items.html.erb
index bd1fca361b..9d802f9818 100644
--- a/storefront/app/views/spree/checkout/_line_items.html.erb
+++ b/storefront/app/views/spree/checkout/_line_items.html.erb
@@ -1,22 +1,7 @@
<%= turbo_frame_tag :checkout_line_items, id: 'line_items', target: '_top' do %>
<% cache spree_base_cache_scope.call(order.line_items.cache_key_with_version) do %>
<div class="overflow-y-auto line-items flex flex-col gap-5 pt-5 md:pt-0" data-checkout-summary-target="line_items">
- <% if order.vendors.any? || order.splitted? %>
- <% order.all_line_items.group_by(&:vendor).each do |vendor, line_items| %>
- <div class="flex flex-col gap-4">
- <% if vendor.present? %>
- <p class="font-normal text-sm">
- <%= Spree.t(:fulfilled_by) %> <span class="font-semibold"><%= vendor.name %></span>
- </p>
- <% end %>
- <div class="flex flex-col gap-3">
- <%= render collection: line_items, partial: 'spree/checkout/line_item', cached: spree_base_cache_scope %>
- </div>
- </div>
- <% end %>
- <% else %>
- <%= render collection: order.line_items, partial: 'spree/checkout/line_item', cached: spree_base_cache_scope %>
- <% end %>
+ <%= render collection: order.line_items, partial: 'spree/checkout/line_item', cached: spree_base_cache_scope %>
</div>
<% end %>
<% end %>
diff --git a/storefront/app/views/spree/checkout/_missing_line_items.html.erb b/storefront/app/views/spree/checkout/_missing_line_items.html.erb
index 8c7117555f..b4c38180ec 100644
--- a/storefront/app/views/spree/checkout/_missing_line_items.html.erb
+++ b/storefront/app/views/spree/checkout/_missing_line_items.html.erb
@@ -3,20 +3,15 @@
<div class="max-h-screen w-full max-w-lg relative">
<div class="m-1 bg-white rounded shadow">
<div class="p-8">
- <h2 class="text-xl mb-4"><%= Spree.t(:shipping_not_available) %></h2>
+ <h2 class="text-xl mb-4"><%= Spree.t('storefront.checkout.shipping_not_available') %></h2>
<p class="mb-4">
- <%= Spree.t('errors.messages.invalid_line_items', count: @order.invalid_line_items.size) %>
+ <%= Spree.t('checkout.errors.invalid_line_items', count: @order.invalid_line_items.size) %>
</p>
<div class="mb-5 overflow-y-auto pt-3 mx-3 lg:mx-8 lg:mt-4 lg:pt-6 line-items" data-checkout-summary-target="line_items">
<% if @order.vendors.any? || @order.splitted? %>
- <% @order.invalid_line_items.group_by(&:vendor).each do |vendor, line_items| %>
+ <% @order.invalid_line_items.each do |line_item| %>
<div class="mb-5">
- <% if vendor.present? %>
- <h5 class="py-3 font-normal text-sm mb-2">
- <%= Spree.t(:fulfilled_by) %> <span class="font-semibold"><%= vendor.name %></span>
- </h5>
- <% end %>
<%= render collection: line_items, partial: 'spree/checkout/line_item', cached: spree_base_cache_scope %>
</div>
<% end %>
@@ -26,8 +21,8 @@
</div>
<div class="flex justify-end items-center flex-wrap mt-6">
- <%= link_to 'return to cart', spree.cart_path, class: 'mx-4 py-4', target: :_top %>
- <%= button_to 'Continue to checkout',
+ <%= link_to Spree.t('storefront.checkout.continue_to_cart'), spree.cart_path, class: 'mx-4 py-4', target: :_top %>
+ <%= button_to Spree.t('storefront.checkout.continue_to_checkout'),
spree.checkout_remove_missing_items_path(@order.token, line_item_ids: @order.invalid_line_items.map(&:id)),
class: 'btn-primary font-semibold checkout-content-save-continue-button my-5 ml-4 !py-4',
method: :delete,
diff --git a/storefront/config/locales/en.yml b/storefront/config/locales/en.yml
index 3deb6fde46..55b5e7cdf2 100644
--- a/storefront/config/locales/en.yml
+++ b/storefront/config/locales/en.yml
@@ -2,6 +2,16 @@ en:
spree:
storefront:
add_to_wishlist: Add to wishlist
+ checkout:
+ back_to_cart: Back to cart
+ continue_to_cart: Continue to cart
+ continue_to_checkout: Continue to checkout
+ delivery_method: Delivery method
+ shipping_not_available: Shipping not available
+ errors:
+ invalid_line_items:
+ one: 'This item will be removed from your cart because there are no delivery methods available for your address.'
+ other: 'These %{count} items will be removed from your cart because there are no delivery methods available for your address.'
wished_items:
select_variant: Select variant to add to wishlist
remove_error: 'You already removed this item from your wishlist'
diff --git a/storefront/spec/controllers/spree/checkout_controller_spec.rb b/storefront/spec/controllers/spree/checkout_controller_spec.rb
index b22b8a4ade..3c3af42063 100644
--- a/storefront/spec/controllers/spree/checkout_controller_spec.rb
+++ b/storefront/spec/controllers/spree/checkout_controller_spec.rb
@@ -100,7 +100,7 @@ describe Spree::CheckoutController, type: :controller do
it 'redirects to login page' do
get :edit, params: { token: order.token }
- expect(response).to redirect_to(spree.new_user_session_path)
+ expect(response).to redirect_to('/login')
end
end