From 861507112d40cd37c6ece526f1cba7f9082b404c Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Fri, 18 Mar 2016 19:05:29 +0100 Subject: [PATCH] Get line item currency from order There seems to be a way of obtaining a line item's currency from it's variant. That doesn't make much sense, as a variant might have many prices in different currencies, but is not tied to a user or an order which would know WHICH of those currencies to use. Yanked an occurrence of `variant.currency` for `order.currency`. --- core/app/models/spree/line_item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app/models/spree/line_item.rb b/core/app/models/spree/line_item.rb index f0af132b90a..fde2f44d704 100644 --- a/core/app/models/spree/line_item.rb +++ b/core/app/models/spree/line_item.rb @@ -136,7 +136,7 @@ def set_pricing_attributes # If the legacy method #copy_price has been overridden, handle that gracefully return handle_copy_price_override if respond_to?(:copy_price) - self.currency ||= variant.currency + self.currency ||= order.currency self.cost_price ||= variant.cost_price self.price ||= variant.price end