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.

Merge pull request #11169 from spree/products-finder-current-store

Damian Legawiecefe76a73f2e2
diff --cc core/app/models/spree/taxon.rb
index d7d59c1b11,fbdf93ef88..146ec12841
--- a/core/app/models/spree/taxon.rb
+++ b/core/app/models/spree/taxon.rb
@@@ -37,10 -37,10 +37,12 @@@ module Spre
has_one :icon, as: :viewable, dependent: :destroy, class_name: 'Spree::TaxonImage'
+ scope :for_store, ->(store) { joins(:taxonomy).where(spree_taxonomies: { store_id: store.id }) }
+
self.whitelisted_ransackable_associations = %w[taxonomy]
+ scope :for_stores, ->(stores) { joins(:taxonomy).where(spree_taxonomies: { store_id: stores.ids }) }
+
# indicate which filters should be used for a taxon
# this method should be customized to your own site
def applicable_filters