Composition of goods in the product slider...

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #160836

Sorry but, I don't understand what you mean. I just replace my code on your and now in slider description displayed all products, but without using override language. Slider displayed only language constants and without commas - STRAWBERRY ANANAS APPLE

Last edit: 11 years 2 months ago by neviqimka.

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

  • Posts: 84298
  • Thank you received: 13697
  • MODERATOR
11 years 2 months ago #160882

Hi,

If you want to have the translation for multiple selections, it gets more complex.
Such code should work:
$values = explode(',',$this->row->bcompound);
foreach($values as $v) echo JText::_($v);

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #161115

Thank you for help, but it's all a little complicated... in my case I must to create 3 custom fields + language constants + change the code which does not gives flexible description. Tell me what you think about my decision - I created one custom field which has text type and added the code in show_block_custom_main.php:

$array = array(
	'STRAWBERRY' => '<a href="strawberry.jpg">strawberry</a>',
	'ANANAS' => '<a href="ananas.jpg">ananas</a>',
	'APPLE' => '<a href="apple.jpg">apple</a>');

$description = str_replace(array_keys($array), $array, $this->fieldsClass->show($oneExtraField,$value));
echo $description;

Last edit: 11 years 2 months ago by neviqimka.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #161380

Hi,

Yes this solution is correct too. The one given by Nicolas is not so complicated, you just have to use his code:

$values = explode(',',$this->row->bcompound);
foreach($values as $v) echo JText::_($v); 

And the translations should be displayed.

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

  • Posts: 126
  • Thank you received: 0
11 years 2 months ago #161520

Thank you and Nicolas for help ;)

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

Time to create page: 0.074 seconds
Powered by Kunena Forum