Last active
August 29, 2015 14:02
-
-
Save peterberkenbosch/98d5e5db3c416419ed88 to your computer and use it in GitHub Desktop.
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::Order.find_each do |order| | |
order_tax_adjustments = order.adjustments.where(source_type: "Spree::TaxRate") | |
if order_tax_adjustments.count > 0 | |
#apply the tax on the line_items | |
Spree::TaxRate.adjust(order, order.line_items) | |
end | |
#remove the order adjustments | |
order_tax_adjustments.collect(&:destroy) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment