Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Default Store Language Rate Topic   - - - - -

 
  • emall
  • Advanced Member
  • Trial users
  • Join Date: 15-Sep 20
  • 79 posts

Posted 15 December 2020 - 08:24 PM #1

I have an issue with the latest update.

 

In 4.11, I was able to change the default store language by modifying

        fn_define('CART_LANGUAGE', $_lc);

This function does not seem to appear in 4.12. How can I change my default store language in the latest version?

 

Thanks

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21722 posts

Posted 16 December 2020 - 04:40 AM #2

Check the fn_init_language function (app/functions/fn.init.php)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • emall
  • Advanced Member
  • Trial users
  • Join Date: 15-Sep 20
  • 79 posts

Posted 16 December 2020 - 08:01 PM #3

Closest think I could find in fn_init was

 

 $session_display_language = fn_get_session_data('cart_language' . $area);

 

I changed it to

 

$session_display_language = fn_get_session_data('cart_language' . 'el')

 

but it doesn't seem to work. Store does not initialize in Greek, as it used to. Any ideas?

 

Thanks



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21722 posts

Posted 17 December 2020 - 04:35 AM #4

As I said, languages are initiated in the fn_init_language function


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • emall
  • Advanced Member
  • Trial users
  • Join Date: 15-Sep 20
  • 79 posts

Posted 17 December 2020 - 06:37 PM #5

Do you see any mistekes in this modification (see red text)? I have changed $area to 'el' but still, store does not initiate in Greek.

 

Thanks

 

 

function fn_init_language($params, $area = AREA)
{
    $default_language = Registry::get('settings.Appearance.' . fn_get_area_name($area) . '_default_language');
    $session_display_language = fn_get_session_data('cart_language' . 'el');
    $session_description_language = fn_get_session_data('descr_sl');

    $languages_search_params = [
        'area'           => $area,
        'include_hidden' => $area !== 'C',
    ];

    $avail_languages = Registry::getOrSetCache(
        ['init_language', 'init_language_' . $area],
        ['languages', 'storefronts_languages'],
        ['static', 'storefront'],
        static function () use ($languages_search_params) {
            return Languages::getAvailable($languages_search_params);



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21722 posts

Posted 18 December 2020 - 04:50 AM #6

Set up default language in the settings to Greek

 

To disable language detection by browser, please replace

 

    } elseif ($browser_language = fn_get_browser_language($avail_languages)) {
        $display_language = $browser_language;
 
with
 
//    } elseif ($browser_language = fn_get_browser_language($avail_languages)) {
//        $display_language = $browser_language;

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • emall
  • Advanced Member
  • Trial users
  • Join Date: 15-Sep 20
  • 79 posts

Posted 19 December 2020 - 04:59 PM #7

Thank you eCOM. Most helpful as always!!