Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'delivery_required' into no_order_mailer

  • Loading branch information...
commit 5dbd49401811e6a91142e927d0b8128ca2b3ba6b 2 parents dd2726e + 7ba6d81
@nateberkopec nateberkopec authored
Showing with 8 additions and 0 deletions.
  1. +6 −0 core/app/models/order.rb
  2. +2 −0  core/lib/spree_core.rb
View
6 core/app/models/order.rb
@@ -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
2  core/lib/spree_core.rb
@@ -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'
Please sign in to comment.
Something went wrong with that request. Please try again.