From ce658e9dfab63d2ba8f11cc4beeed6fdd3f55747 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Thu, 28 Feb 2019 12:16:47 +1100 Subject: [PATCH] Fix error computing payment fee when order-based --- app/models/spree/payment_decorator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/spree/payment_decorator.rb b/app/models/spree/payment_decorator.rb index 8aab22a7bb..6b5f954a10 100644 --- a/app/models/spree/payment_decorator.rb +++ b/app/models/spree/payment_decorator.rb @@ -33,7 +33,8 @@ module Spree # This is called by the calculator of a payment method def line_items if order.complete? && Spree::Config[:track_inventory_levels] - order.line_items.select { |li| inventory_units.pluck(:variant_id).include?(li.variant_id) } + inventory_item_ids = order.distributor.inventory_items.pluck(:variant_id) + order.line_items.select { |li| inventory_item_ids.include?(li.variant_id) } else order.line_items end