Skip to content

Commit

Permalink
Fix Express checkout locale
Browse files Browse the repository at this point in the history
  • Loading branch information
firstred committed Oct 10, 2017
1 parent 7445155 commit 5e3ad0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paypal.php
Expand Up @@ -819,6 +819,7 @@ public function hookHeader()
[
static::LIVE => Configuration::get(static::LIVE),
'incontextType' => (Tools::getValue('controller') == 'product') ? 'product' : 'cart',
'paypal_locale' => $this->getLocale(),
]
);

Expand All @@ -834,7 +835,6 @@ public function hookHeader()
) {
$this->context->smarty->assign(
[
'paypal_locale' => $this->getLocale(),
'client_id' => Configuration::get(static::CLIENT_ID),
'login_theme' => Configuration::get(static::LOGIN_THEME),
'live' => Configuration::get(static::LIVE),
Expand Down Expand Up @@ -869,7 +869,7 @@ public function getLocale()
*/
public static function getLocaleByIso($iso)
{
switch ($iso) {
switch (strtolower($iso)) {
case 'fr':
return 'fr_FR';
case 'hk':
Expand Down
1 change: 1 addition & 0 deletions views/templates/front/paypaljs.tpl
Expand Up @@ -43,6 +43,7 @@
$('#container_express_checkout').empty();
paypal.Button.render({
env: {if $PAYPAL_LIVE}'production'{else}'sandbox'{/if}, // Optional: specify 'sandbox' environment
locale: '{$paypal_locale|escape:'javascript':'UTF-8'}',
payment: function (resolve, reject) {
{if $incontextType == 'product'}
// Prepare the cart first
Expand Down

0 comments on commit 5e3ad0b

Please sign in to comment.