Email Custom Field Formatting
- twhcreations
-
Topic Author
- Offline
Less
More
10 years 4 months ago #239765
by twhcreations
Email Custom Field Formatting was created by twhcreations
-- HikaShop version -- : HikaShop Business: 2.6.2
-- Joomla version -- : 3.5.1
-- PHP version -- : 7.0.5
-- Browser(s) name and version -- : Firefox 46.0.1
Hi,
I have a client who wants to alter the format of the custom fields in their notification email (admin).
I'd like to be able to edit the label and positioning of the custom fields, currently from what i can gather, it appears that all the custom fields are being inserted into the email in a single variable:
<p style="border-bottom:1px solid #7D7D7D;padding-bottom:10px;font-size:16px;">
{VAR:ORDER_SUMMARY}
</p>
This content is formatting as a single paragraph. We would like to breakup these fields and add spacing.
Where can we modify the php that is generating this content? is it accessible though display->views?
Is there a list that outlines these variables, and is it possible to manually enter the custom fields that get put into the email?
Cheers
-- Joomla version -- : 3.5.1
-- PHP version -- : 7.0.5
-- Browser(s) name and version -- : Firefox 46.0.1
Hi,
I have a client who wants to alter the format of the custom fields in their notification email (admin).
I'd like to be able to edit the label and positioning of the custom fields, currently from what i can gather, it appears that all the custom fields are being inserted into the email in a single variable:
<p style="border-bottom:1px solid #7D7D7D;padding-bottom:10px;font-size:16px;">
{VAR:ORDER_SUMMARY}
</p>
This content is formatting as a single paragraph. We would like to breakup these fields and add spacing.
Where can we modify the php that is generating this content? is it accessible though display->views?
Is there a list that outlines these variables, and is it possible to manually enter the custom fields that get put into the email?
Cheers
Please Log in or Create an account to join the conversation.
10 years 4 months ago #239782
by nicolas
Replied by nicolas on topic Email Custom Field Formatting
Hi,
When you edit the email, at the bottom of the screen you have the "preload" area which is where you'll find all the PHP code which initialize the tags that are used in the HTML version.
So that's where you want to look.
It's this code:
When you edit the email, at the bottom of the screen you have the "preload" area which is where you'll find all the PHP code which initialize the tags that are used in the HTML version.
So that's where you want to look.
It's this code:
Code:
ob_start();
$sep = '';
if(hikashop_level(2)) {
$fields = $fieldsClass->getFields('display:field_order_admin_notification=1',$data,'order','');
foreach($fields as $fieldName => $oneExtraField) {
if(empty($data->cart->$fieldName))
continue;
echo $sep . $fieldsClass->trans($oneExtraField->field_realname).' : '.$fieldsClass->show($oneExtraField, $data->cart->$fieldName,'admin_email');
$sep = '<br />';
}
}
JPluginHelper::importPlugin('hikashop');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onAfterOrderProductsListingDisplay', array(&$data->cart, 'email_notification_html'));
$content = ob_get_clean();
$vars['ORDER_SUMMARY'] = trim($content);
The following user(s) said Thank You: twhcreations
Please Log in or Create an account to join the conversation.
Time to create page: 0.180 seconds