remove_checkout_step
and pass in the name of the step you want to remove. For example, if you wanted to remove the address step, your decorator might look like this:add_checkout_step
in the order decorator, and pass in your custom step name, as well as a before
or after
attribute, so that the order state machine knows where to put this custom step in the checkout flow.before_#{checkout_step_name}
exists. If it does, it runs that method. That means that you can run custom logic before the controller moves on to your step, which can be handy if you want to set things up for the view.checkout_confirm_attributes
set in an initializer.payment
uses checkout_payment_attributes
, address
uses checkout_address_attributes
, and so on. checkout_confirm_attributes
is used for the confirm step, and for any step that the checkout controller does not recognize - like our new custom step.add_checkout_step
. For example, if we only want to include our custom step if the orders total is over $50, we can pass that requirement in as a conditional: