- Posts: 88
- Thank you received: 20
Custom email template - tags styling override issue
4 years 4 months ago - 4 years 4 months ago #341224
by dyvel
Custom email template - tags styling override issue was created by dyvel
-- 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
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
-- 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
Code:
<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: 4 years 4 months ago by dyvel.
Please Log in or Create an account to join the conversation.
4 years 4 months ago #341236
by nicolas
Replied by nicolas on topic Custom email template - tags styling override issue
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:
so you can modify the HTML in there.
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:
Code:
$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>';
The following user(s) said Thank You: dyvel
Please Log in or Create an account to join the conversation.
Time to create page: 0.172 seconds