Hi,
First, the code:
// Ensure Hikashop helper is loaded
if (!class_exists('hikashopFieldClass')) {
if (!include_once(JPATH_ADMINISTRATOR . '/components/com_hikashop/helpers/helper.php')) {
return;
}
}
should not do anything. The event onHikashopBeforeDisplayView is only called by the main helper file of HikaShop. So if your method is called, HikaShop is already loaded. Thus, you can remove it.
Second, in onHikashopBeforeDisplayView the field data is already loaded in the view and the view will use the data already loaded. So there is no need to load the field data, and you need instead to update the field data in the view.
So, you want to use something like this:
$lenew = new stdClass();
$lenew->value = "azur";
$lenew->disabled = 0;
$view->extraFields['user']['teacher_name']->field_value['bleue'] = $lenew;