Module in product view

  • Posts: 1077
  • Thank you received: 11
  • Hikashop Business
2 years 2 months ago #347463

-- HikaShop version -- : 4.7.0
-- Joomla version -- : 3.10.11

Hello,

I edited the show_default.php file to add a module at the right part of the product, the problem is that i have a 2 language website so i set the language of the module to Greek or English but it still appears in both languages.
Any ideas how to fix this?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83338
  • Thank you received: 13476
  • MODERATOR
2 years 2 months ago #347466

Hi,

What code did you use to add the module ? Without knowing your code, I can't say what you did wrong.
I would personnally do it like that:

<?php
$moduleHelper = hikashop_get('helper.module');
$modules = $moduleHelper->setModuleData(array(XX, YY, ZZ));
	if(!empty ($modules) && is_array($modules)) {
		jimport('joomla.application.module.helper');
		foreach($modules as $module) {
			echo JModuleHelper::renderModule($module);
		}
	}
?>
where XX, YY and ZZ are ids of the modules (one for each language). The setModuleData would automatically filter out the modules based on the current language and the associated language in each module and then the renderModule function would display the remaining modules.
That's similar code we use for the "Modules under the product page" setting of the HikaShop configuration.

The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum