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.

Memoize FrontendHelper#price_filter_values

Damian Legawiec23b895aa093c
diff --git a/frontend/app/helpers/spree/frontend_helper.rb b/frontend/app/helpers/spree/frontend_helper.rb
index 01d7884643..5e54033e3d 100644
--- a/frontend/app/helpers/spree/frontend_helper.rb
+++ b/frontend/app/helpers/spree/frontend_helper.rb
@@ -248,7 +248,7 @@ module Spree
end
def price_filter_values
- [
+ @price_filter_values ||= [
"#{I18n.t('activerecord.attributes.spree/product.less_than')} #{formatted_price(50)}",
"#{formatted_price(50)} - #{formatted_price(100)}",
"#{formatted_price(101)} - #{formatted_price(150)}",