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: show checkout links in checkout footer :)

Damian Legawiec882a3ca11b77
diff --git a/storefront/app/views/themes/default/spree/checkout/_footer.html.erb b/storefront/app/views/themes/default/spree/checkout/_footer.html.erb
index 46e3a43dd1..f69d6b5f2a 100644
--- a/storefront/app/views/themes/default/spree/checkout/_footer.html.erb
+++ b/storefront/app/views/themes/default/spree/checkout/_footer.html.erb
@@ -1,9 +1,13 @@
<% cache spree_storefront_base_cache_scope.call(current_store) do %>
- <% if current_store.policies.any? %>
+ <% if current_store.links.any? %>
<div class="flex flex-col gap-4 text-sm">
<ul class="flex justify-center flex-wrap gap-4">
- <% current_store.policies.each do |policy| %>
- <%= link_to policy.name, spree.policy_path(policy), target: '_blank' %>
+ <% current_store.links.each do |link| %>
+ <li>
+ <%= page_builder_link_to link, { target: ('_blank' if link.open_in_new_tab), rel: ('noopener noreferrer' if link.open_in_new_tab) } do %>
+ <%= link.label %>
+ <% end %>
+ </li>
<% end %>
</ul>
</div>
diff --git a/storefront/spec/features/checkout_steps_spec.rb b/storefront/spec/features/checkout_steps_spec.rb
index ac90cec889..03d4de773d 100644
--- a/storefront/spec/features/checkout_steps_spec.rb
+++ b/storefront/spec/features/checkout_steps_spec.rb
@@ -621,6 +621,15 @@ describe 'Checkout steps (address and delivery)' do
expect(page.current_path).to eq('/user/sign_in')
end
end
+
+ describe 'checkout links' do
+ let!(:link) { create(:page_link, parent: store) }
+
+ it 'shows checkout links' do
+ visit "/checkout/#{order.token}"
+ expect(page).to have_content(link.label)
+ end
+ end
end
def login_from_checkout