Vit Kos
Vit Kos

Reputation: 5755

Switch Prestashop Language programmatically

I have got a module, that uses displayTop hook for some actions. after that i would like to switch language to desired that exists in the system. I found a method Tools::switchLanguage but I can't figure out how to use it properly. any clues?

Upvotes: 1

Views: 905

Answers (1)

romainberger
romainberger

Reputation: 4558

There is a module that already does that: blocklanguages. So you can either use this module or take a look at the code to see how it's done. It's pretty easy so you can implement that wherever you want.

Upvotes: 1

Related Questions