Created
July 10, 2011 14:18
-
-
Save bver/1074574 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator::FreeShipping < Calculator | |
preference :threshold, :decimal, :default => 0 | |
def available?(order) | |
order.item_total >= self.preferred_threshold | |
end | |
def self.description | |
I18n.t("free_shipping") | |
end | |
def self.register | |
super | |
ShippingMethod.register_calculator(self) | |
end | |
def compute(object=nil) | |
0.0 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment