mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Add a flash error where no available shipping methods to the customer
+ update specs as well
This commit is contained in:
@@ -23,6 +23,8 @@ class SplitCheckoutController < ::BaseController
|
||||
redirect_to_step_based_on_order unless params[:step]
|
||||
check_step if params[:step]
|
||||
recalculate_tax if params[:step] == "summary"
|
||||
|
||||
flash_error_when_no_shipping_method_available if available_shipping_methods.none?
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -47,6 +49,10 @@ class SplitCheckoutController < ::BaseController
|
||||
|
||||
private
|
||||
|
||||
def flash_error_when_no_shipping_method_available
|
||||
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
|
||||
end
|
||||
|
||||
def clear_invalid_payments
|
||||
@order.payments.with_state(:invalid).delete_all
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user