In Spree 2.0.3 , How would I remove shipping addre

2019-09-06 17:31发布

问题:

I tried to create app/models/spree/order_decorator.rb as :

Spree::Order.class_eval do
  checkout_flow do
  go_to_state :address
  go_to_state :payment, :if => lambda { |order| order.payment_required? }
   go_to_state :confirm, :if => lambda { |order| order.confirmation_required? }
   go_to_state :complete
   remove_transition :from => :delivery, :to => :confirm
  end
end

but this code only removes delivery process , I think I have to make some changes in order model but that was too complicated for me , anybody pls help me out for what are changes has to be done to achieve this ?

Also I have to remove validation for shipping method..so that i can go next page of check out flow.

thanx in advance.

回答1:

Have you reviewed the docs on the checkout flow API?

http://guides.spreecommerce.com/developer/checkout.html



标签: spree