Update Variant#default_price

This commit is contained in:
Matt-Yorkley
2021-03-26 19:19:30 +00:00
parent 2be04cc25c
commit eccfcbc396

View File

@@ -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