diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index 986f8ee..43d5a1e 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -1,6 +1,6 @@ Spree::LineItem.class_eval do def tax_cloud_cache_key - key = "Spree::LineItem #{id}: #{quantity}x<#{variant.cache_key}>@#{price}#{currency}" + key = "Spree::LineItem #{id}: #{quantity}x<#{variant.cache_key}>@#{price}#{currency}pre_tax_amount<#{pre_tax_amount}>" if order.ship_address key << "shipped_to<#{order.ship_address.try(:cache_key)}>" elsif order.bill_address diff --git a/app/models/spree/tax_cloud.rb b/app/models/spree/tax_cloud.rb index a5d1728..eb37060 100644 --- a/app/models/spree/tax_cloud.rb +++ b/app/models/spree/tax_cloud.rb @@ -48,7 +48,7 @@ def self.cart_item_from_item(item, index) index: index, item_id: item.try(:variant).try(:sku).present? ? item.try(:variant).try(:sku) : "LineItem #{item.id}", tic: (item.product.tax_cloud_tic || Spree::Config.taxcloud_default_product_tic), - price: item.price, + price: item.quantity == 0 ? item.price : item.pre_tax_amount / item.quantity, quantity: item.quantity ) when Spree::Shipment