[Skip to main content](#vessel-content)

#   Custom email template - tags styling override issue

##

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

4 years 6 months ago -  4 years 6 months ago [\#341224](#341224) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  *[Custom email template - tags styling override issue](/forum/31-development/904332-custom-email-template-tags-styling-override-issue#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&#95;NAME}) contain its own css style that I'm unable to override.  I've tried creating a  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  definition.  In my template I'm currently using this code with no inline style  The inline CSS that gets added to {TXT:CUSTOMFIELD&#95;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")* was created by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")*

-- 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 &lt;style&gt; 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 &lt;style&gt; definition.

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

&lt;tr class="order-details-header"&gt; &lt;td&gt;{TXT:PRODUCT_NAME}&lt;/td&gt; {TXT:CUSTOMFIELD_NAME} &lt;td&gt;{TXT:PRODUCT_PRICE}&lt;/td&gt; &lt;td&gt;{TXT:PRODUCT_QUANTITY}&lt;/td&gt; &lt;td&gt;{TXT:PRODUCT_TOTAL}&lt;/td&gt; &lt;/tr&gt;

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 6 months ago by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDMzMi1jdXN0b20tZW1haWwtdGVtcGxhdGUtdGFncy1zdHlsaW5nLW92ZXJyaWRlLWlzc3VlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

4 years 6 months ago [\#341236](#341236) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom email template - tags styling override issue](/forum/31-development/904332-custom-email-template-tags-styling-override-issue#341236 "-- 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&#95;NAME}) contain its own css style that I'm unable to override.  I've tried creating a  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  definition.  In my template I'm currently using this code with no inline style  The inline CSS that gets added to {TXT:CUSTOMFIELD&#95;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")*

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

$texts['CUSTOMFIELD_NAME'].='&lt;td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right;color:#1c8faf !important;font-size:12px;font-weight:bold;"&gt;'.$fieldsClass-&gt;getFieldName($field).'&lt;/td&gt;';

so you can modify the HTML in there.

The following user(s) said Thank You: [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDMzMi1jdXN0b20tZW1haWwtdGVtcGxhdGUtdGFncy1zdHlsaW5nLW92ZXJyaWRlLWlzc3VlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
