Custom email template - tags styling override issue

  • Posts: 88
  • Thank you received: 19
2 years 6 months ago #341224

-- HikaShop version -- : 4.5.1
-- Joomla version -- : 4.x
-- PHP version -- : 8.x

Hi

I'm working on a custom template for emails sent by HIkashop on order update. I have a problem that the tag for custom fields ({TXT:CUSTOMFIELD_NAME}) contain its own css style that I'm unable to override.

I've tried creating a <style> definition with .order-details-header td and simply change the color of the text, but the color is implemented with the !important classification for the color and therefore can't be overridden by the style in my <style> definition.

In my template I'm currently using this code with no inline style

<tr class="order-details-header">
	<td>{TXT:PRODUCT_NAME}</td>
	{TXT:CUSTOMFIELD_NAME}
	<td>{TXT:PRODUCT_PRICE}</td>
	<td>{TXT:PRODUCT_QUANTITY}</td>
	<td>{TXT:PRODUCT_TOTAL}</td>
</tr>

The inline CSS that gets added to {TXT:CUSTOMFIELD_NAME} is:
border-bottom:1px solid #ddd;padding-bottom:3px;text-align:left;color:#1c8faf !important;font-size:12px;font-weight:bold;

This makes it hard to adopt the colors to match the website style.
Any options to fix this?

Thanks

Last edit: 2 years 6 months ago by dyvel.

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
2 years 6 months ago #341236

Hi,

That's because the {TXT:CUSTOMFIELD_NAME} tag can contain several columns. So the HTML has to be generated when the tag data is generated.
However, that's not a problem. Edit your email, and instead of looking at the HTML version, scroll down to the "preload version".
There, you'll see all the PHP code of the email to generate all the tags used in the HTML version.
And you'll see in particular that line:

$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>';
so you can modify the HTML in there.

The following user(s) said Thank You: dyvel

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

Time to create page: 0.032 seconds
Powered by Kunena Forum