In Spree 2.0.3 , How would I remove shipping address in Spree checkout routine?

雨燕双飞 提交于 2020-01-07 05:48:28

问题


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



来源:https://stackoverflow.com/questions/17328221/in-spree-2-0-3-how-would-i-remove-shipping-address-in-spree-checkout-routine

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!