Reduce expensive tax recalculation calls

This can only really be enabled once we've merged the split checkout
This commit is contained in:
Matt-Yorkley
2022-01-29 17:31:53 +00:00
parent e63225d389
commit 448e4bb67b

View File

@@ -310,6 +310,8 @@ module Spree
# Creates new tax charges if there are any applicable rates. If prices already
# include taxes then price adjustments are created instead.
def create_tax_charge!
return if state.in?(["cart", "address", "delivery"]) && Flipper.enabled?(:split_checkout)
clear_legacy_taxes!
Spree::TaxRate.adjust(self, line_items)