From 2a6d83b4ddd9e9eda7bee789f3c176f669f78240 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sat, 8 Aug 2020 15:28:37 +0100 Subject: [PATCH] Remove confirm checkout step and it's additional removal --- app/models/spree/order.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index bfafea0ec4..f572663171 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -21,16 +21,10 @@ module Spree order.update_totals order.payment_required? } - go_to_state :confirm, if: ->(order) { order.confirmation_required? } go_to_state :complete remove_transition from: :delivery, to: :confirm end - # Orders are confirmed with their payment, we don't use the confirm step. - # Here we remove that step from Spree's checkout state machine. - # See: https://guides.spreecommerce.org/developer/checkout.html#modifying-the-checkout-flow - remove_checkout_step :confirm - state_machine.after_transition to: :payment, do: :charge_shipping_and_payment_fees! state_machine.event :restart_checkout do @@ -248,11 +242,6 @@ module Spree total.to_f > 0.0 && !skip_payment_for_subscription? end - # If true, causes the confirmation step to happen during the checkout process - def confirmation_required? - payments.map(&:payment_method).compact.any?(&:payment_profiles_supported?) - end - # Indicates the number of items in the order def item_count line_items.inject(0) { |sum, li| sum + li.quantity }