Jump to content
thirty bees forum

Question

Posted

Hi, all,
I have a question about this small problem :
we are selling only for the italian market, only IT language activated and using the default paypal module with TB 1.0.8, but our italian customer get redirected to an english version of the Paypal checkout page ...
Only payment standard is activated, no express checkout
i contacted the Paypal tecnical support for help thinking maybe some configuration to change on their side, but they answered that on my integration i have to insert or change the variable LOCALCODE passed during the API call ....
I checked with no result where this variable is set.... or there is some configuration i miss?

anyone can help me to find the way to set this variable correctly so to get the correct language ( italian ) checkout page on paypal?
Thanks in advance for yours suggestion!

2 answers to this question

Recommended Posts

  • 0
Posted (edited)

Try to help myself .. 🙂
Maybe I was looking the wrong place ... i checked through module's classes ansd controllers, but i think the right file is the paypal.php on the module's root ... i find out and add or change the iso code as follow on the functions getLocaleByIso and hoockPayment
 

    public static function getLocaleByIso($iso)
    {
        switch (strtolower($iso)) {
            case 'it':
                return 'it_IT';
            case 'fr':
                return 'fr_FR';
						case 'hk':
                return 'zh_HK';
            case 'cn':
                return 'zh_CM';
            case 'tw':
                return 'zh_TW';
            case 'xc':
                return 'zh_XC';
            case 'dk':
                return 'da_DK';
            case 'nl':
                return 'nl_NL';
            case 'gb':
                return 'en_GB';
            case 'de':
                return 'de_DE';
            case 'il':
                return 'he_IL';
            case 'id':
                return 'id_ID';
            case 'jp':
                return 'ja_JP';
            case 'no':
                return 'no_NO';
            case 'pt':
                return 'pt_PT';
            case 'pl':
                return 'pl_PL';
            case 'ru':
                return 'ru_RU';
            case 'es':
                return 'es_ES';
            case 'se':
                return 'sv_SE';
            case 'th':
                return 'th_TH';
            case 'tr':
                return 'tr_TR';
            default:
                return 'en_US';
        }
    }

and here ....

    public function hookPayment($params)
    {
        $isoLang = [
            'en' => 'en_US',
            'it' => 'it_IT',
            'fr' => 'fr_FR',
            'de' => 'de_DE',
            'nl' => 'nl_NL',
        ];

        $this->context->smarty->assign(
            [
                'logos'            => PayPalLogos::getLogos($this->getLocale()),
                static::LIVE       => \Configuration::get(static::LIVE),
                'use_mobile'       => true,
                'PayPal_lang_code' => (isset($isoLang[$this->context->language->iso_code])) ? $isoLang[$this->context->language->iso_code] : 'it_IT',
                'params'           => $params,
            ]
        );

Following some more change for express and plus checkout ... this is only for standard
I don't know if is working now ... i will update the post if solved after tested(and maybe publish an "how to^ with step by step on the italian forum if somebody find my same problem) ....

Edited by ariom
  • 0
Posted

IT works!!!
Just to make this on an override to not loose the changes when upgrading the module
maybe can be useful for any other locale is not on the list 🙂

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...