Is there an easy way to skip the Delivery and Paym...
# support
x
Is there an easy way to skip the Delivery and Payment steps during checkout? Trying to turn the checkout into more of a "request for quote" so these steps aren't needed.
j
You'll probably have to do some hacking around things, but you can redefine the checkout flow to remove them if you need to. Not sure how the docs are on how to do that.
a
Should be able to use
#remove_checkout_step
in an initializer to remove those two steps.
Alternatively, you could redefine the checkout flow as suggested in the guides: https://guides.solidus.io/developers/orders/order-state-machine.html#customizing-the-checkout-flow
x
Awesome, exactly what I was looking for I think, thank you both!
Trying to get this to work. Commenting out the delivery and payment steps does only show Address, Confirm, and Complete at the top, but you can't get pass Address. The continue button just reloads the page. Added back in Delivery and I can get to the step, but continuing past Delivery brings you back to Address.
j
there are likely more things you need to override than just that, you'll have to dig into the code to see what additional validations/requirements are kicking in
a
@Xan You probably will need to go through state_machine transition actions. Have a look in
core/lib/spree/core/state_machines/order.rb
There are a lot of action calls before and after transition and their failure might be redirecting you back to previous state.