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.

Add more documentation links and config options in the default spree initializer

Damian Legawiecc304acc52190
diff --git a/core/lib/generators/spree/install/templates/config/initializers/spree.rb b/core/lib/generators/spree/install/templates/config/initializers/spree.rb
index eb67d2d4e6..26b8a3f66b 100644
--- a/core/lib/generators/spree/install/templates/config/initializers/spree.rb
+++ b/core/lib/generators/spree/install/templates/config/initializers/spree.rb
@@ -9,17 +9,40 @@
#
# In order to initialize a setting do:
# config.setting_name = 'new value'
+#
+# More on configuring Spree preferences can be found at:
+# https://dev-docs.spreecommerce.org/internals/preferences
Spree.config do |config|
# Example:
# Uncomment to stop tracking inventory levels in the application
# config.track_inventory_levels = false
end
+# Use a CDN host for images, eg. Cloudfront
+# This is used in the frontend to generate absolute URLs to images
+# Default is nil and your application host will be used
+# Spree.cdn_host = 'cdn.example.com'
+
+# Use a different service for storage (S3, google, etc)
+# unless Rails.env.test?
+# Spree.private_storage_service_name = :amazon_public # public assets, such as product images
+# Spree.public_storage_service_name = :amazon_private # private assets, such as invoices, etc
+# end
+
+# Use a different search engine for products
+# You can check the default search class at:
+# https://github.com/spree/spree/blob/main/core/lib/spree/core/search/base.rb
+# and use it as base class for your custom searcher
+# eg. MySearcher < Spree::Core::Search::Base
+# Spree.searcher_class = 'MySearcher'
+
# Configure Spree Dependencies
#
# Note: If a dependency is set here it will NOT be stored within the cache & database upon initialization.
# Just removing an entry from this initializer will make the dependency value go away.
#
+# More on how to use Spree dependencies can be found at:
+# https://dev-docs.spreecommerce.org/customization/dependencies
Spree.dependencies do |dependencies|
# Example:
# Uncomment to change the default Service handling adding Items to Cart
@@ -29,3 +52,5 @@ end
# Spree::Api::Dependencies.storefront_cart_serializer = 'MyRailsApp::CartSerializer'
Spree.user_class = <%= (options[:user_class].blank? ? 'Spree::LegacyUser' : options[:user_class]).inspect %>
+# Use a different class for admin users
+# Spree.admin_user_class = 'AdminUser'