Tom Wilson
09/13/2021, 2:46 PM:delivery state. I know that stock locations can be marked as fulfillable or not to help support this, but I don't see any exemptions in the checkout state machine looking for that property.Chris Moore
09/13/2021, 2:53 PMTom Wilson
09/13/2021, 3:12 PMChris Moore
09/13/2021, 3:13 PMTom Wilson
09/13/2021, 3:14 PMChris Moore
09/13/2021, 3:16 PMTom Wilson
09/13/2021, 3:16 PMTom Wilson
09/13/2021, 3:17 PMnil address: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/shipping_method.rb#L77Chris Moore
09/13/2021, 3:18 PMremove_checkout_step above? You shouldn’t even see the shipment method if so.Chris Moore
09/13/2021, 3:19 PMTom Wilson
09/13/2021, 3:20 PMOrder.ensure_shipping_address to return true if the order is all digital.Tom Wilson
09/13/2021, 3:21 PMaddress or delivery?Chris Moore
09/13/2021, 3:22 PMmodule Spree
module OrderDecorator
Spree::Order.class_eval do
remove_checkout_step :delivery
end
end
endChris Moore
09/13/2021, 3:22 PMTom Wilson
09/13/2021, 3:22 PMTom Wilson
09/13/2021, 3:26 PMremove_checkout_step supports an options block. Is there something I can read a bit further about the pattern of conditionally removing the step?Tom Wilson
09/13/2021, 3:27 PMremove_checkout_step :delivery
insert_checkout_step :delivery { if: :my_method }Tom Wilson
09/13/2021, 3:31 PMremove followed by insert seems to work. So something like this:
base.remove_checkout_step :delivery
base.insert_checkout_step :delivery, {
before: :payment, if: -> (order) { order.requires_shipping? }
}Chris Moore
09/13/2021, 3:31 PMChris Moore
09/13/2021, 3:31 PM