Jump to content
Patrick T.

[Solved] Multilanguage module

Recommended Posts

Hi all, this my first post on this forum.

 

I'm trying to write a module with a multilanguage support. For the back-office i've achieved the result but when i try the module on the shop i've no output.

 

With this module i'm trying to write a string based on the selected language on shop, the string is saved in two configuration parameters, but when write the hook code i don't find the way to assign the value based on the selected language on the shop.

 

Any help is appreciated.

 

Cheers, Patrick T.

 

This is the code i'm use to display the message in the shop, on the left conlumn:

public function hookDisplayLeftColumn($params) {

 $shopContext = Context::getContext();

 $shopLangId = (int) $shopContext->language->id;

 $this->context->smarty->assign(
  array(
'my_module_name' => Configuration::get('MYMODULE_NAME_'.$shopLangId),
'my_module_link' => $shopContext->link->getModuleLink('mymodule', 'display')
  )
 );

 return $this->display(__FILE__, 'mlmodule.tpl');
}

 

Prestashop version: 1.5.4.0

Edited by Patrick T. (see edit history)

Share this post


Link to post
Share on other sites

I've inserted a call to the getLanguages() function in the module constructor, and this break the execution

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More