In OpenCart stores, a common issue is the default language of the site. Although store owners choose the default language in the store settings, customers visiting the site for the first time may not see the store in that default language. This issue is caused by the Browser Language Detection feature in browsers.


What is Browser Language Detection?

Browser Language Detection is a feature in web browsers that allows them to determine the user's preferred language based on the browser settings. In other words, the browser reads the language of the operating system and automatically determines the language of the store based on that.

Problem:

This feature causes an issue for store owners, as they want to display a specific language by default for customers. Therefore, browser language detection must be disabled.

Solution:

The solution is to disable or delete the browser language detection feature

To disable the browser language detection feature, the code responsible for this feature in the startup.php file located in the catalogue/controller/startup/startup.php path must be deleted or commented out. The line responsible for this feature is:

$code = $detect ? $detect : '';


After deleting or commenting out this line, the store will work in the default language selected in the settings.


To make it easier for our customers, we have created an Extension that does this task by just installing it and it is free of charge

Download link