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.

Display store payment methods

Krzysztof Kalisz5b72d2c94aab
diff --git a/frontend/app/views/spree/checkout/_payment.html.erb b/frontend/app/views/spree/checkout/_payment.html.erb
index 4ea16023ef..dd49f56137 100644
--- a/frontend/app/views/spree/checkout/_payment.html.erb
+++ b/frontend/app/views/spree/checkout/_payment.html.erb
@@ -8,12 +8,12 @@
<%= render partial: 'spree/checkout/payment/storecredit' %>
<ul id="payment-method-fields" class="list-unstyled position-relative" data-hook>
- <% @order.available_payment_methods.each do |method| %>
+ <% @order.available_payment_methods(current_store).each do |method| %>
<li class="radio">
<%= label_tag '', class: "form-check-label spree-radio-label payment-option", data: { type: method.id == @payment_sources&.first&.payment_method_id ? 'card' : nil } do %>
<%= radio_button_tag "order[payments_attributes][][payment_method_id]",
method.id,
- method.id == @order.payments.checkout.last&.payment_method_id || method == @order.available_payment_methods.first %>
+ method.id == @order.payments.checkout.last&.payment_method_id || method == @order.available_payment_methods(current_store).first %>
<span class="spree-radio-label-custom-input"></span>
<%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
<% end %>
@@ -43,8 +43,8 @@
<% end %>
<ul id="payment-methods" class="list-unstyled position-relative mb-0 payment-sources-add-form" data-hook>
- <% @order.available_payment_methods.each do |method| %>
- <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods.last %>" data-hook>
+ <% @order.available_payment_methods(current_store).each do |method| %>
+ <li id="payment_method_<%= method.id %>" class="<%= 'last' if method == @order.available_payment_methods(current_store).last %>" data-hook>
<fieldset>
<%= render partial: "spree/checkout/payment/#{method.method_type}", locals: { payment_method: method } %>
</fieldset>