- Posts: 126
- Thank you received: 0
Composition of goods in the product slider...
12 years 3 months ago - 12 years 3 months ago #160836
by neviqimka
Replied by neviqimka on topic Composition of goods in the product slider...
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: 12 years 3 months ago by neviqimka.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #160882
by nicolas
Replied by nicolas on topic Composition of goods in the product slider...
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);
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.
12 years 3 months ago - 12 years 3 months ago #161115
by neviqimka
Replied by neviqimka on topic Composition of goods in the product slider...
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:
Code:
$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: 12 years 3 months ago by neviqimka.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #161380
by Xavier
Replied by Xavier on topic Composition of goods in the product slider...
Hi,
Yes this solution is correct too. The one given by Nicolas is not so complicated, you just have to use his code:
And the translations should be displayed.
Yes this solution is correct too. The one given by Nicolas is not so complicated, you just have to use his code:
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.
12 years 3 months ago #161520
by neviqimka
Replied by neviqimka on topic Composition of goods in the product slider...
Thank you and Nicolas for help
Please Log in or Create an account to join the conversation.
Time to create page: 0.182 seconds