Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal Smart Payment Buttons: How to change the language

How can I change the language of a PayPal Smart Payment Button?

My current code looks like this:

paypal.Buttons({
  locale: 'en_US',
  style: {
    size: 'small',
    color: 'gold',
    shape: 'pill',
    label: 'pay',
    layout: 'horizontal',
    fundingicons: 'false',
    height: 46
  }
}).render('#paypal-button-container');

Locale is not changing the language to English.

like image 327
Philipp S. Avatar asked Feb 10 '20 11:02

Philipp S.


People also ask

What are PayPal smart payment buttons?

Smart Payment Buttons by PayPal are designed to improve the checkout experience and improve checkout conversions. With this integration, you can give customers the option to pay with PayPal, Venmo, and major credit cards and debit cards - on almost any device - when they checkout with PayPal.

How do I turn off PayPal smart button?

Unfortunately, there is no way to remove the PayPal button from the smart buttons checkout as that is a core requirement of the smart buttons checkout.


1 Answers

PayPal's sdk/js does not use a 'locale' option parameter. That syntax is from the older checkout.js

By default the language of the buttons will be according to the browser language setting. If you need to override this auto detection and force a particular language to match the rest of the site, for the current SDK you add the locale to the <script> query string, as documented here: https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-configuration/#locale

like image 165
Preston PHX Avatar answered Oct 03 '22 13:10

Preston PHX