From 202b0041d174a5e0cface44903411e426b1508be Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:59:57 +0100 Subject: [PATCH] Remove voucher processing from checkout edit action --- app/controllers/split_checkout_controller.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index c7396b39dd..31f2368b69 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -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