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.

revert changes to Spree::FrontendHelper#price_filter_values

Łukasz Adamczykb63a67a78cda
diff --git a/frontend/app/helpers/spree/frontend_helper.rb b/frontend/app/helpers/spree/frontend_helper.rb
index 20be41a0ed..72cdaf47f5 100644
--- a/frontend/app/helpers/spree/frontend_helper.rb
+++ b/frontend/app/helpers/spree/frontend_helper.rb
@@ -239,7 +239,13 @@ module Spree
end
def price_filter_values
- @price_filter_values ||= price_filters.map(&:to_s)
+ @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)}",
+ "#{formatted_price(151)} - #{formatted_price(200)}",
+ "#{formatted_price(201)} - #{formatted_price(300)}"
+ ]
end
def static_filters
@@ -360,6 +366,10 @@ module Spree
Filters::Price.new(amount: amount, currency: current_currency)
end
+ def formatted_price(value)
+ Spree::Money.new(value, currency: current_currency, no_cents_if_whole: true).to_s
+ end
+
def credit_card_icon(type)
available_icons = %w[visa american_express diners_club discover jcb maestro master]