diff --git a/config/initializers/admin_actions.rb b/config/initializers/admin_actions.rb new file mode 100644 index 0000000000..9a3b67fed7 --- /dev/null +++ b/config/initializers/admin_actions.rb @@ -0,0 +1,8 @@ +Rails.application.config.after_initialize do + Rails.application.config.spree_backend.actions[:product] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build + Rails.application.config.spree_backend.actions.include?(:images) ? (Rails.application.config.spree_backend.actions[:images].items << Spree::Admin::Actions::ProductPreviewActionBuilder.new.build.items).flatten! : Rails.application.config.spree_backend.actions[:images] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build + Rails.application.config.spree_backend.actions[:prices] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build + Rails.application.config.spree_backend.actions[:stock] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build + Rails.application.config.spree_backend.actions.include?(:variants) ? (Rails.application.config.spree_backend.actions[:variants].items << Spree::Admin::Actions::ProductPreviewActionBuilder.new.build.items).flatten! : Rails.application.config.spree_backend.actions[:variants] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build + Rails.application.config.spree_backend.actions.include?(:product_properties) ? (Rails.application.config.spree_backend.actions[:product_properties].items << Spree::Admin::Actions::ProductPreviewActionBuilder.new.build.items).flatten! : Rails.application.config.spree_backend.actions[:product_properties] = Spree::Admin::Actions::ProductPreviewActionBuilder.new.build +end