How to turn off browser language autodetect in OpenCart

Why? Is OpenCart showing another language to my users, even when they have no session.

How? OpenCart has a built in language autodetect feature, that looks into the user’s browser language and tries to show that language instead of the default OpenCart language.

Language Autodetect Fix (OCmod)

They can be misleading to some. The code is located:
for 2.2.x and 3.x in file
– catalog/controller/startup/startup.php

– comment out
$code = $detect ? $detect : ”;

for 2.1.x and below in file
– index.php

– comment out the line
$code = $detect ? $detect : $config→get(‘config_language’);


One comment

  1. If you ever wondered why when visiting your multilanguage OpenCart store some people see a language other then your default one, this video will answer that. We have had several support tickets asking us about this feature. They were pretty annoyed with it and they couldn't find where it was coming from. Hey, even we were a bit confused. So here is the video that should help you solve this task. Enjoy!

Comments are closed.