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.

Use `Spree::Taxon.for_store` scope when resolving taxons in Products finder (#12087)

m.b.1bf6e2fcc36d
diff --git a/core/app/finders/spree/products/find.rb b/core/app/finders/spree/products/find.rb
index 50844e80a7..f66b2a355b 100644
--- a/core/app/finders/spree/products/find.rb
+++ b/core/app/finders/spree/products/find.rb
@@ -263,7 +263,7 @@ module Spree
def taxon_ids(taxons_ids)
return if taxons_ids.nil? || taxons_ids.to_s.blank?
- taxons = store.taxons.where(id: taxons_ids.to_s.split(','))
+ taxons = Spree::Taxon.for_store(store).where(id: taxons_ids.to_s.split(','))
taxons.map(&:cached_self_and_descendants_ids).flatten.compact.uniq.map(&:to_s)
end