Jump to content

How i can add condition if lang in php module file (prestashop 1.6)


Guest

Recommended Posts

Hello there.

PHP Code in my module

$params = array(
            "SessionType" => "Pay",
            "TemplateTag" => "En",
            "Language" => "En",

);

 

How i can add condition if lang in this code to define language and to direct to the necessary template.

for example

if lang ru

$params = array(
            "SessionType" => "Pay",
            "TemplateTag" => "Ru",
            "Language" => "Ru",

);

else

$params = array(
            "SessionType" => "Pay",
            "TemplateTag" => "En",
            "Language" => "En",

);

 

Thank you all.

Edited by andrew0808 (see edit history)
Link to comment
Share on other sites

6 hours ago, Rolige said:

if (Context::getContext()->language->iso_code == 'iso lang code here')

 

Yes. it works.

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...