Hi,
When you edit the email via the menu System>Emails, you have first the HTML version where you found the tag you're talking about, in the HTML code of the email.
If you scroll down, you'll see the "preload" area, which contains PHP code to generate all the tags used in the HTML version.
There, you'll see this piece of code which adds the data of the custom item fields to the product name tag:
if(!empty($itemFields)){
foreach($itemFields as $field){
$namekey = $field->field_namekey;
if(empty($item->$namekey) || !strlen($item->$namekey)) continue;
$t .= '<p>'.$fieldsClass->getFieldName($field).': '.$fieldsClass->show($field,$item->$namekey,'admin_email').'</p>';
}
}
Note that this code is for custom fields of the table "item" that the customer can fill in on the product details page above the add to cart button.
If you're talking about custom fields of the table "product", that you fill in in the backend product edition area, then it's these pieces of code:
$null = null;
$fields = null;
$texts['CUSTOMFIELD_NAME'] = '';
$texts['FOOTER_COLSPAN'] = 3;
if(hikashop_level(1)){
$fields = $fieldsClass->getFields('display:mail_admin_notif=1',$null,'product');
if(!empty($fields)){
$product_customfields = array();
$usefulFields = array();
foreach($fields as $field){
$namekey = $field->field_namekey;
foreach($productClass->all_products as $product){
if(!empty($product->$namekey)){
$usefulFields[] = $field;
break;
}
}
}
$fields = $usefulFields;
}
if(!empty($fields)){
foreach($fields as $field){
$texts['FOOTER_COLSPAN']++;
$texts['CUSTOMFIELD_NAME'].='<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right;color:#1c8faf !important;font-size:12px;font-weight:bold;">'.$fieldsClass->getFieldName($field).'</td>';
}
}
}
$cartProduct['CUSTOMFIELD_VALUE'] = '';
if(!empty($fields) && hikashop_level(1)){
foreach($fields as $field){
$namekey = $field->field_namekey;
$productData = @$productClass->all_products[$item->product_id];
$cartProduct['CUSTOMFIELD_VALUE'] .= '<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">'.(empty($productData->$namekey)?'':$fieldsClass->show($field,$productData->$namekey)).'</td>';
}
}