Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Created April 30, 2014 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iloveitaly/55919b98fd41a5e03ae0 to your computer and use it in GitHub Desktop.
Save iloveitaly/55919b98fd41a5e03ae0 to your computer and use it in GitHub Desktop.
Disable tax calculation on an order in Spree Commerce
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