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.

Storefront - support more injection points for tracking partials (#12395)

Damian Legawiec66af055990c4
diff --git a/storefront/lib/spree/storefront/engine.rb b/storefront/lib/spree/storefront/engine.rb
index ed944108e3..83d0e759b1 100644
--- a/storefront/lib/spree/storefront/engine.rb
+++ b/storefront/lib/spree/storefront/engine.rb
@@ -3,7 +3,13 @@ require_relative 'runtime_configuration'
module Spree
module Storefront
class Engine < ::Rails::Engine
- Environment = Struct.new(:head_partials)
+ Environment = Struct.new(
+ :head_partials,
+ :body_start_partials,
+ :body_end_partials,
+ :checkout_partials,
+ :checkout_complete_partials
+ )
initializer 'spree.storefront.configuration', before: :load_config_initializers do |_app|
Spree::Storefront::RuntimeConfig = Spree::Storefront::RuntimeConfiguration.new
@@ -24,6 +30,10 @@ module Spree
config.after_initialize do
Rails.application.config.spree_storefront.head_partials = []
+ Rails.application.config.spree_storefront.body_start_partials = []
+ Rails.application.config.spree_storefront.body_end_partials = []
+ Rails.application.config.spree_storefront.checkout_partials = []
+ Rails.application.config.spree_storefront.checkout_complete_partials = []
end
end
end