mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Display no shipping method selected error
This commit is contained in:
@@ -103,6 +103,10 @@
|
||||
padding-right: 5px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
|
||||
&.standalone {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
#distributor_address.panel {
|
||||
|
||||
@@ -39,6 +39,9 @@ class SplitCheckoutController < ::BaseController
|
||||
advance_order_state
|
||||
redirect_to_step
|
||||
else
|
||||
if params[:shipping_method_id].blank?
|
||||
@order.errors.add(:base, "no_shipping_method_selected")
|
||||
end
|
||||
flash.now[:error] = "Saving failed, please update the highlighted fields"
|
||||
render :edit
|
||||
end
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
= t("split_checkout.step1.delivery_address.title")
|
||||
|
||||
- selected_shipping_method = @order.shipping_method&.id
|
||||
- if selected_shipping_method == nil && @order.errors.messages_for(:base).include?("no_shipping_method_selected")
|
||||
%div.checkout-input
|
||||
%span.formError.standalone
|
||||
= t("split_checkout.step1.delivery_address.errors.no_shipping_method_selected")
|
||||
- @shipping_methods.each do |shipping_method|
|
||||
%div.checkout-input
|
||||
= fields_for shipping_method do |shipping_method_form|
|
||||
|
||||
@@ -1660,6 +1660,8 @@ en:
|
||||
label: Country
|
||||
delivery_address:
|
||||
title: Delivery address
|
||||
errors:
|
||||
no_shipping_method_selected: No shipping method selected
|
||||
submit: Next - Payment method
|
||||
cancel: Back to Edit basket
|
||||
step2:
|
||||
|
||||
Reference in New Issue
Block a user