Class: Spree::Calculator::FreeShipping

Inherits:
Spree::Calculator show all
Defined in:
app/models/spree/calculator/free_shipping.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Spree::Calculator

#available?, calculators, #description, #to_s

Methods inherited from Base

page, spree_base_scopes

Methods included from Preferences::Preferable

#clear_preferences, #default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.descriptionObject



3
4
5
# File 'app/models/spree/calculator/free_shipping.rb', line 3

def self.description
  Spree.t(:free_shipping)
end

Instance Method Details

#compute(object) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/spree/calculator/free_shipping.rb', line 7

def compute(object)
  ActiveSupport::Deprecation.warn("    Spree::Calculator::FreeShipping will be removed in Spree 3.3\n    The only case where it was used was for Free Shipping Promotions.\n    There is now a Promotion Action which deals with these types of promotions instead\n  EOS\n  if object.is_a?(Array)\n    return if object.empty?\n    order = object.first.order\n  else\n    order = object\n  end\n\n  order.ship_total\nend\n", caller)