Hello,
Thank you for your answer but this is a bit too technical for me.
With regards to the translation, I've tried the following code but it is still not displaying the translation when I'm on the French page. Do you know what I could change in order to have the translation display on the page?
$id = $product->product_id;
if(!empty($product->product_parent_id))
$id = $product->product_parent_id;
$productClass = hikashop_get('class.product');
$categories = $productClass->getCategories($id);
$firstCategoryId = reset($categories);
$categoryClass = hikashop_get('class.category');
$category = $categoryClass->get($firstCategoryId);
$field = $this->fieldsClass->getField('categoryname_forcart', 'category');
echo $this->fieldsClass->show($field, $this->element->categoryname_forcart);
I removed the last line of the code you gave me
echo $category->categoryname_forcart;
and replaced it with:
$field = $this->fieldsClass->getField('categoryname_forcart', 'category');
echo $this->fieldsClass->show($field, $this->element->categoryname_forcart);
I have created 2 custom fields of the type WYSIWYG (one product table and one category table). The code I shared here is the one I used for the category custom field.