Hi,
The reason your email is getting cut off is that product custom fields are displayed as extra columns in the product table. With 6 or 7 custom fields, each one adds a column to the table, making it much wider than what email clients can display.
The solution is to move the custom fields from separate columns into the product name cell, so they display vertically below the product name instead. This requires editing two files for the email template: the HTML layout and the preload file.
Go to System > Emails in the HikaShop backend, then click on "order_creation_notification" to edit it. You will see two sections: "HTML version" and "Preload". You need to change both.
In the "HTML version" section:
Find and remove this line in the table header:
{TXT:CUSTOMFIELD_NAME}
And remove this line in the product row:
{LINEVAR:CUSTOMFIELD_VALUE}
This removes the extra columns from the table. But you still need to display the custom fields somewhere. So in the "Preload" section, you will move them inside the product name.
In the "Preload" section:
Find the block that generates CUSTOMFIELD_VALUE (around line 200):
$cartProduct['CUSTOMFIELD_VALUE'] = '';
if(!empty($fields) && hikashop_level(1)){
foreach($fields as $field){
$namekey = $field->field_namekey;
$productData = @$productClass->all_products[$item->product_id];
$field->currentElement = $productData;
$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>';
}
}Replace it with:
$cartProduct['CUSTOMFIELD_VALUE'] = '';
if(!empty($fields) && hikashop_level(1)){
foreach($fields as $field){
$namekey = $field->field_namekey;
$productData = @$productClass->all_products[$item->product_id];
$field->currentElement = $productData;
if(!empty($productData->$namekey)){
$t .= '<p style="margin:2px 0;font-size:11px;color:#555;"><strong>'.$fieldsClass->getFieldName($field).':</strong> '.$fieldsClass->show($field,$productData->$namekey).'</p>';
}
}
}This appends each custom field as a "Label: Value" line below the product name, inside the same cell. Your table will then only have the 4 standard columns (Product Name, Price, Quantity, Total) and the custom field values will be listed vertically under each product name.
If you also use the order admin notification or order status notification or order notification emails, you will need to apply the same changes to those email templates as well.