Email Custom Field Formatting

  • Posts: 127
  • Thank you received: 8
8 years 6 months ago #239765

-- 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

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 6 months ago #239782

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:

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.054 seconds
Powered by Kunena Forum