diff --git a/core/app/models/order.rb b/core/app/models/order.rb index fee8ea9..55261f5 100755 --- a/core/app/models/order.rb +++ b/core/app/models/order.rb @@ -83,8 +83,10 @@ def item_count event :next do transition :from => 'cart', :to => 'address' + transition :from => 'address', :to => 'delivery', :if => :delivery_required? transition :from => 'address', :to => 'payment' - transition :from => 'payment', :to => 'complete' + transition :from => 'delivery', :to => 'payment' + transition :from => 'payment', :to => 'complete' end event :cancel do @@ -167,6 +169,10 @@ def restore_state end + def delivery_required? + false + end + before_validation :clone_billing_address, :if => "@use_billing" attr_accessor :use_billing