Translation for custom field not showing up

  • Posts: 27
  • Thank you received: 4
  • Hikashop Essential
6 months 3 weeks ago #359770

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.2
-- Browser(s) name and version -- : Firefox

Hello,

I’ve created a custom field (WYSIWYG) and added it in the hikashop/ display/ views – “show_tabular” file where the price is originally located using the below command (“originalartwork” is the column name of my custom field) :

<?php echo $this->element->originalartwork; ?>

I’ve enabled “translatable” in the custom field setting and turned off display on the front-end, so that my custom field's content doesn’t appear in the specifications’ section. The custom field's box appears when I click on the French language file (translations) for a specific product; however, when I enter the French text, save the file and check the French page on the frontend, it shows the English text, not the French translation that I’ve entered. The French text I entered for the description of the product is appearing when I open the product’s French page though.

Is there something I’m not doing well?

Here is the link to the page I’ve been working on to try the layout/ settings:

www.noelieceyralartstudio.com/index.php/...-la-vie-et-a-l-amour

Thank you!

Last edit: 6 months 3 weeks ago by Noe.

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

  • Posts: 82570
  • Thank you received: 13293
  • MODERATOR
6 months 3 weeks ago #359784

Hi,

The code you're using is the code to display the value of the custom field for the product directly from the database, without any processing.
So you would have to use code like this instead:

<?php 
$field = $this->fieldsClass->getField('originalartwork', 'product');
echo $this->fieldsClass->show($field, $this->element->originalartwork);
?>
This will handle translations, content tags, etc.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum