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.

Improve performance of filtering products by property

Damian Legawiec120776bed04a
diff --git a/core/app/finders/spree/products/find.rb b/core/app/finders/spree/products/find.rb
index 116d44e430..fc38579e00 100644
--- a/core/app/finders/spree/products/find.rb
+++ b/core/app/finders/spree/products/find.rb
@@ -186,7 +186,7 @@ module Spree
next if values.empty?
- ids = products.with_property_values(property_filter_param, values).ids
+ ids = scope.unscope(:order, :includes).with_property_values(property_filter_param, values).ids
product_ids = index == 0 ? ids : product_ids & ids
index += 1
end