jakemumu
05/24/2023, 10:14 PMbase.remove_checkout_step :confirm
# our custom confirm step
base.insert_checkout_step :tax_confirmation, {
after: :payment, if: ->(order) {
order.tax_total != 0
}
}
-- however this totally breaks checkout and i just get an obtuse error: State cannot transition via next
-- any tips for debugging that?Adam Mueller
05/24/2023, 11:02 PMcomplete
from the final checkout step to the completed
state, and all other checkout states transition on next
.Spree::Order.state_machines[:state].events
)base.state_machines[:state].event :complete do
transition to: :complete, from: :payment
end
jakemumu
05/25/2023, 1:31 AMbase.state_machine.after_transition(to: :confirm) do |order|
order.complete if order.tax_total.zero? && order.can_complete?
end