mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove voucher processing from checkout edit action
This commit is contained in:
@@ -24,7 +24,6 @@ class SplitCheckoutController < ::BaseController
|
||||
def edit
|
||||
redirect_to_step_based_on_order unless params[:step]
|
||||
check_step if params[:step]
|
||||
apply_voucher if @order.voucher_adjustments.present?
|
||||
|
||||
flash_error_when_no_shipping_method_available if available_shipping_methods.none?
|
||||
end
|
||||
@@ -204,6 +203,7 @@ class SplitCheckoutController < ::BaseController
|
||||
|
||||
def process_voucher
|
||||
if add_voucher
|
||||
VoucherAdjustmentsService.calculate(@order)
|
||||
render_voucher_section_or_redirect
|
||||
elsif @order.errors.present?
|
||||
render_error
|
||||
@@ -308,12 +308,4 @@ class SplitCheckoutController < ::BaseController
|
||||
redirect_to checkout_step_path(:payment) if params[:step] == "summary"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def apply_voucher
|
||||
VoucherAdjustmentsService.calculate(@order)
|
||||
|
||||
# update order to take into account the voucher we applied
|
||||
@order.update_order!
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user