This code is from customfields.php in CustomsFieldCartDisplay function:
foreach ($variantmods as $variant=>$selected){
if ($selected) {
$productCustom = self::getProductCustomFieldCart ($selected );
if(!empty($productCustom)){
$html .= ' <span class="product-field-type-'.$productCustom->field_type.'">';
$value ='';
if ($productCustom->field_type == "E") {
} elseif (($productCustom->field_type == "G")) {
$child = self::getChild($productCustom->custom_value);
// $html .= $productCustom->custom_title.' '.$child->product_name;
$value = $child->product_name;
} elseif (($productCustom->field_type == "M")) {
// $html .= $productCustom->custom_title.' '.self::displayCustomMedia($productCustom->custom_value);
$value = self::displayCustomMedia($productCustom->custom_value);
} elseif (($productCustom->field_type == "S")) {
// q $html .= $productCustom->custom_title.' '.JText::_($productCustom->custom_value);
$value = $productCustom->custom_value;
} else {
// $html .= $productCustom->custom_title.' '.$productCustom->custom_value;
$value = $productCustom->custom_value;
}
$html .=ShopFunctionsF::translateTwoLangKeys($productCustom->custom_title,$value);
$html .= '</span>';
} else {
vmdebug('CustomsFieldCartDisplay, $productCustom is empty ');
}
}
$row++;
}
if ($variantmods ) {
$product = self::addParam($product);
if(!class_exists('vmCustomPlugin')) require(JPATH_VM_PLUGINS.DS.'vmcustomplugin.php');
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('plgVmOnViewCart',array($product, $row,&$html));
}
You see, that we add html code for every field, including the plugin type (E) fields:
$html .=ShopFunctionsF::translateTwoLangKeys($productCustom->custom_title,$value);
And after that, we trigger 'plgVmOnViewCart' and custom plugin itself add its value to html:
$dispatcher->trigger('plgVmOnViewCart',array($product, $row,&$html));
That is why we got title appears twice. I think we need to skip E-type fields in the loop and don't add any html code for them.