Permalink
Browse files

Merge branch 'delivery_required' into no_order_mailer

  • Loading branch information...
2 parents dd2726e + 7ba6d81 commit 5dbd49401811e6a91142e927d0b8128ca2b3ba6b @nateberkopec nateberkopec committed Jan 3, 2013
Showing with 8 additions and 0 deletions.
  1. +6 −0 core/app/models/order.rb
  2. +2 −0 core/lib/spree_core.rb
View
@@ -73,6 +73,10 @@ def payment_required?
total.to_f > 0.0
end
+ def delivery_required?
+ false
+ end
+
# Indicates the number of items in the order
def item_count
line_items.map(&:quantity).sum
@@ -83,6 +87,8 @@ def item_count
event :next do
transition :from => 'cart', :to => 'address'
+ transition :from => 'address', :to => 'delivery', :if => :delivery_required?
+ transition :from => 'delivery', :to => 'payment'
transition :from => 'address', :to => 'payment'
transition :from => 'payment', :to => 'complete'
end
View
@@ -40,6 +40,8 @@
require 'find_by_param'
require 'jquery-rails'
+ActiveSupport::Deprecation.silenced = true
+
require 'spree_core/ext/active_record'
require 'spree_core/ext/hash'

0 comments on commit 5dbd494

Please sign in to comment.