diff --git a/app/models/spree/variant.rb b/app/models/spree/variant.rb index 275863beeb..2937687af7 100644 --- a/app/models/spree/variant.rb +++ b/app/models/spree/variant.rb @@ -34,7 +34,7 @@ module Spree accepts_nested_attributes_for :images has_one :default_price, - -> { where currency: Spree::Config[:currency] }, + -> { with_deleted.where(currency: Spree::Config[:currency]) }, class_name: 'Spree::Price', dependent: :destroy has_many :prices, @@ -152,11 +152,6 @@ module Spree select("spree_variants.id")) end - # Allow variant to access associated soft-deleted prices. - def default_price - Spree::Price.unscoped { super } - end - def price_with_fees(distributor, order_cycle) price + fees_for(distributor, order_cycle) end