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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Update config naming to pluralized as per rails routing conversion.
Matthew Kennedy11e6a63d0303
diff --git a/core/app/models/spree/app_configuration.rb b/core/app/models/spree/app_configuration.rbindex 1029b3cf7f..7458061611 100644--- a/core/app/models/spree/app_configuration.rb+++ b/core/app/models/spree/app_configuration.rb@@ -76,9 +76,9 @@ module Spree@searcher_class ||= Spree::Core::Search::Baseend- # These paths are used if Spree::Frontend is not being used.- preference :storefront_product_path, :string, default: 'products'- preference :storefront_taxon_path, :string, default: 't'+ # Sets the path used for products and taxons.+ preference :storefront_products_path, :string, default: 'products'+ preference :storefront_taxons_path, :string, default: 't'attr_writer :searcher_classenddiff --git a/core/app/models/spree/menu_item.rb b/core/app/models/spree/menu_item.rbindex 8d4a2746ea..03a3d9f2aa 100644--- a/core/app/models/spree/menu_item.rb+++ b/core/app/models/spree/menu_item.rb@@ -48,7 +48,7 @@ module Spreeif frontend_available?Spree::Core::Engine.routes.url_helpers.nested_taxons_path(linked_resource.permalink)else- "/#{Spree::Config[:storefront_taxon_path]}/#{linked_resource.permalink}"+ "/#{Spree::Config[:storefront_taxons_path]}/#{linked_resource.permalink}"endwhen 'Spree::Product'return if linked_resource.nil?@@ -56,7 +56,7 @@ module Spreeif frontend_available?Spree::Core::Engine.routes.url_helpers.product_path(linked_resource)else- "/#{Spree::Config[:storefront_product_path]}/#{linked_resource.slug}"+ "/#{Spree::Config[:storefront_products_path]}/#{linked_resource.slug}"endwhen 'Home Page''/'diff --git a/frontend/config/routes.rb b/frontend/config/routes.rbindex abdd79dfd6..246828ff63 100644--- a/frontend/config/routes.rb+++ b/frontend/config/routes.rb@@ -2,11 +2,11 @@ Spree::Core::Engine.add_routes doscope '(:locale)', locale: /#{Spree.available_locales.join('|')}/, defaults: { locale: nil } doroot to: 'home#index'- resources :products, only: [:index, :show], path: "/#{Spree::Config[:storefront_product_path]}"+ resources :products, only: [:index, :show], path: "/#{Spree::Config[:storefront_products_path]}"- get "/#{Spree::Config[:storefront_product_path]}/:id/related", to: 'products#related'+ get "/#{Spree::Config[:storefront_products_path]}/:id/related", to: 'products#related'# route globbing for pretty nested taxon and product paths- get "/#{Spree::Config[:storefront_taxon_path]}/*id", to: 'taxons#show', as: :nested_taxons+ get "/#{Spree::Config[:storefront_taxons_path]}/*id", to: 'taxons#show', as: :nested_taxonsget '/product_carousel/:id', to: 'taxons#product_carousel'# non-restful checkout stuff