Skip to content

Commit

Permalink
Add PayPal button customizable sytle also for cart page
Browse files Browse the repository at this point in the history
This PR solidusio#236
was incomplete since adds PayPal button customizable parameters only for
checkout/payment step. This PR adds the same feature also for
cart page.
  • Loading branch information
Flavio Auciello committed Oct 18, 2019
1 parent c21f870 commit a221348
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/views/spree/shared/_paypal_cart_button.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/initializers/braintree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

if SolidusSupport.frontend_available?
Spree::CheckoutController.helper :braintree_checkout
Spree::OrdersController.helper :braintree_checkout
end

0 comments on commit a221348

Please sign in to comment.