From a221348a2840e223581348942f7bc3d53e47cd99 Mon Sep 17 00:00:00 2001 From: Flavio Auciello Date: Fri, 18 Oct 2019 16:31:58 +0200 Subject: [PATCH] Add PayPal button customizable sytle also for cart page This PR https://github.com/solidusio/solidus_paypal_braintree/pull/236 was incomplete since adds PayPal button customizable parameters only for checkout/payment step. This PR adds the same feature also for cart page. --- app/views/spree/shared/_paypal_cart_button.html.erb | 10 +++++++++- config/initializers/braintree.rb | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/spree/shared/_paypal_cart_button.html.erb b/app/views/spree/shared/_paypal_cart_button.html.erb index cc7a1e20..c640f0c6 100644 --- a/app/views/spree/shared/_paypal_cart_button.html.erb +++ b/app/views/spree/shared/_paypal_cart_button.html.erb @@ -6,7 +6,15 @@ var paypalOptions = { flow: 'vault', enableShippingAddress: true, - environment: '<%= Rails.env.production? ? "production" : "sandbox" %>' + environment: '<%= Rails.env.production? ? "production" : "sandbox" %>', + locale: '<%= paypal_button_preference(:paypal_button_locale, store: current_store) %>', + style: { + color: '<%= paypal_button_preference(:paypal_button_color, store: current_store) %>', + size: '<%= paypal_button_preference(:paypal_button_size, store: current_store) %>', + shape: '<%= paypal_button_preference(:paypal_button_shape, store: current_store) %>', + label: '<%= paypal_button_preference(:paypal_button_label, store: current_store) %>', + tagline: '<%= paypal_button_preference(:paypal_button_tagline, store: current_store) %>' + } } var options = { restart_checkout: true diff --git a/config/initializers/braintree.rb b/config/initializers/braintree.rb index 77c51874..1f370736 100644 --- a/config/initializers/braintree.rb +++ b/config/initializers/braintree.rb @@ -4,4 +4,5 @@ if SolidusSupport.frontend_available? Spree::CheckoutController.helper :braintree_checkout + Spree::OrdersController.helper :braintree_checkout end