Hi,
There is no echo of anything in your code, so it's normal it doesn't display anything.
Since you're apparently trying to display something on the product page using the onHikashopBeforeDisplayView trigger, you can look at the code we have in the plugins/hikashop/shippingmanual_prices/shippingmanual_prices.php file since that plugin can be configured to display the shipping fees of the products on the product page.
There, you'll also find a onHikashopBeforeDisplayView function and at the end of it, you can see that code:
if(!isset($view->element->extraData))
$view->element->extraData = new stdClass();
if(!isset($view->element->extraData->$position))
$view->element->extraData->$position = array();
array_push($view->element->extraData->$position, $data);
This code will add the html contained in the $data variable and add it in the position defined in the $position variable.
You can look at the XML file next to that PHP file to know the possible values you can have in $position:
<option value="topBegin">TOP_BEGIN</option>
<option value="topEnd">TOP_END</option>
<option value="leftBegin">LEFT_BEGIN</option>
<option value="leftEnd">LEFT_END</option>
<option value="rightBegin">RIGHT_BEGIN</option>
<option value="rightMiddle">RIGHT_MIDDLE</option>
<option value="rightEnd">RIGHT_END</option>
<option value="bottomBegin">BOTTOM_BEGIN</option>
<option value="bottomMiddle">BOTTOM_MIDDLE</option>
<option value="bottomEnd">BOTTOM_END</option>