Page 1 of 1

Switch default language

Posted: Tue Nov 21, 2017 4:36 pm
by faca5
Hello.

How I can switch default language using PHP command in exp. "index.php"?

I found these files related with language.
\system\library\language.php
\system\config\default.php

I like to create language switcher related with IP address.

Example:
If someone visit from UK they get english, if someone visit from Germany they get auto selected germany language etc.

Any idea?

Re: Switch default language

Posted: Tue Nov 21, 2017 6:43 pm
by paulfeakins
Are there not any extensions to do this?

Re: Switch default language

Posted: Tue Nov 21, 2017 8:21 pm
by kestas
faca5 wrote:
Tue Nov 21, 2017 4:36 pm
Hello.

How I can switch default language using PHP command in exp. "index.php"?

I found these files related with language.
\system\library\language.php
\system\config\default.php

I like to create language switcher related with IP address.

Example:
If someone visit from UK they get english, if someone visit from Germany they get auto selected germany language etc.

Any idea?
Hi,
I think you should make language autoswitcher in this file catalog/controller/common/language.php
Or find some extension.

I have not tried yet. :)

Good Luck

Re: Switch default language

Posted: Tue Nov 21, 2017 8:25 pm
by sachin6609
faca5 wrote:
Tue Nov 21, 2017 4:36 pm
Hello.

How I can switch default language using PHP command in exp. "index.php"?

I found these files related with language.
\system\library\language.php
\system\config\default.php

I like to create language switcher related with IP address.

Example:
If someone visit from UK they get english, if someone visit from Germany they get auto selected germany language etc.

Any idea?

Hii

https://www.opencart.com/index.php?rout ... g=3&page=7

https://www.opencart.com/index.php?rout ... load_id=49

Thx

sachin

Re: Switch default language

Posted: Wed Nov 22, 2017 4:07 pm
by faca5
Thank you all!

Re: Switch default language

Posted: Wed Nov 22, 2017 9:20 pm
by faca5
I have added PHP code into "catalog/controller/startup/startup.php". Now it works.