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

#   Custom fields output too much margin around each one

##

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

Less More

- Posts: 31
- Thank you received: 1
-
-
- [](https://www.matcom.co.uk)
-

6 years 1 month ago [\#325264](#325264) by [nevillematthews](/forum/user/39340-nevillematthews "View nevillematthews's Profile")  *[Custom fields output too much margin around each one](/forum/27-checkout/901081-custom-fields-output-too-much-margin-around-each-one#325264 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.4.10 -- Browser(s) name and version -- : Firefox Developer 82.0b9(64-bit)  Hi  I am using 6 custom fields per line item on a product line.  When it produces the output for the custom feilds in emails and reports there is way to much space around each one.  I want to modify all the output so this space is reduced.  I have found one example but the custom fields seem to be embedded inside {LINEVAR:PRODUCT&#95;NAME}. assuming this is where they are.  Example Email - &quot;Order creation notification&quot; ----- Where do I find the layout or construction of {LINEVAR:PRODUCT&#95;NAME}.  Thank you  Neville Matthews")* was created by *[nevillematthews](/forum/user/39340-nevillematthews "View nevillematthews's Profile")*

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.4.10
-- Browser(s) name and version -- : Firefox Developer 82.0b9(64-bit)

Hi

I am using 6 custom fields per line item on a product line.

When it produces the output for the custom feilds in emails and reports there is way to much space around each one.

I want to modify all the output so this space is reduced.

I have found one example but the custom fields seem to be embedded inside {LINEVAR:PRODUCT_NAME}. assuming this is where they are.

Example
Email - "Order creation notification"

---

Where do I find the layout or construction of {LINEVAR:PRODUCT_NAME}.

Thank you

Neville Matthews

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTA4MS1jdXN0b20tZmllbGRzLW91dHB1dC10b28tbXVjaC1tYXJnaW4tYXJvdW5kLWVhY2gtb25lP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

6 years 1 month ago [\#325266](#325266) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields output too much margin around each one](/forum/27-checkout/901081-custom-fields-output-too-much-margin-around-each-one#325266 "-- HikaShop version -- : 4.4.0 -- Joomla version -- : 3.9.1 -- PHP version -- : 7.4.10 -- Browser(s) name and version -- : Firefox Developer 82.0b9(64-bit)  Hi  I am using 6 custom fields per line item on a product line.  When it produces the output for the custom feilds in emails and reports there is way to much space around each one.  I want to modify all the output so this space is reduced.  I have found one example but the custom fields seem to be embedded inside {LINEVAR:PRODUCT&#95;NAME}. assuming this is where they are.  Example Email - &quot;Order creation notification&quot; ----- Where do I find the layout or construction of {LINEVAR:PRODUCT&#95;NAME}.  Thank you  Neville Matthews")*

Hi,

When you edit the email via the menu System&gt;Emails, you have first the HTML version where you found the tag you're talking about, in the HTML code of the email.
If you scroll down, you'll see the "preload" area, which contains PHP code to generate all the tags used in the HTML version.
There, you'll see this piece of code which adds the data of the custom item fields to the product name tag: Code:

if(!empty($itemFields)){ foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($item-&gt;$namekey) &#124;&#124; !strlen($item-&gt;$namekey)) continue; $t .= '&lt;p&gt;'.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey,'admin_email').'&lt;/p&gt;'; } }

Note that this code is for custom fields of the table "item" that the customer can fill in on the product details page above the add to cart button.
If you're talking about custom fields of the table "product", that you fill in in the backend product edition area, then it's these pieces of code: Code:

$null = null; $fields = null; $texts['CUSTOMFIELD_NAME'] = ''; $texts['FOOTER_COLSPAN'] = 3; if(hikashop_level(1)){ $fields = $fieldsClass-&gt;getFields('display:mail_admin_notif=1',$null,'product'); if(!empty($fields)){ $product_customfields = array(); $usefulFields = array(); foreach($fields as $field){ $namekey = $field-&gt;field_namekey; foreach($productClass-&gt;all_products as $product){ if(!empty($product-&gt;$namekey)){ $usefulFields[] = $field; break; } } } $fields = $usefulFields; } if(!empty($fields)){ foreach($fields as $field){ $texts['FOOTER_COLSPAN']++; $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;'; } } }

Code:

$cartProduct['CUSTOMFIELD_VALUE'] = ''; if(!empty($fields) &amp;&amp; hikashop_level(1)){ foreach($fields as $field){ $namekey = $field-&gt;field_namekey; $productData = @$productClass-&gt;all_products[$item-&gt;product_id]; $cartProduct['CUSTOMFIELD_VALUE'] .= '&lt;td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right"&gt;'.(empty($productData-&gt;$namekey)?'':$fieldsClass-&gt;show($field,$productData-&gt;$namekey)).'&lt;/td&gt;'; } }

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMTA4MS1jdXN0b20tZmllbGRzLW91dHB1dC10b28tbXVjaC1tYXJnaW4tYXJvdW5kLWVhY2gtb25lP3RtcGw9bWFya2Rvd24=) 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.039 seconds

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