Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed: `LineItem#product` to also return soft-deleted products (#12078)

Damian Legawiec3a1dd82281ed
diff --git a/core/app/models/spree/line_item.rb b/core/app/models/spree/line_item.rb
index 8899820d06..358fb00104 100644
--- a/core/app/models/spree/line_item.rb
+++ b/core/app/models/spree/line_item.rb
@@ -13,7 +13,7 @@ module Spree
end
belongs_to :tax_category, -> { with_deleted }, class_name: 'Spree::TaxCategory'
- has_one :product, through: :variant
+ has_one :product, -> { with_deleted }, class_name: 'Spree::Product', through: :variant
has_many :adjustments, as: :adjustable, dependent: :destroy
has_many :inventory_units, inverse_of: :line_item