Created
April 30, 2014 21:08
-
-
Save iloveitaly/55919b98fd41a5e03ae0 to your computer and use it in GitHub Desktop.
Disable tax calculation on an order in Spree Commerce
This file contains hidden or 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
Spree::TaxRate.class_eval do | |
# UPGRADE_CHECK https://github.com/spree/spree/blob/1-3-stable/core/app/models/spree/tax_rate.rb#L33 | |
def self.adjust(order) | |
order.clear_adjustments! | |
# TODO you'll have to customize this based on your situation | |
if order.taxable_flag? | |
return | |
end | |
self.match(order).each do |rate| | |
rate.adjust(order) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment