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

#   How to add extra information field invoice to pdf

##

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

Less More

- Posts: 138
- Thank you received: 1
-
-

12 years 1 month ago [\#175420](#175420) by [extreme](/forum/user/27729-extreme "View extreme's Profile")  *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#175420 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")* was created by *[extreme](/forum/user/27729-extreme "View extreme's Profile")*

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 2.5.19
-- PHP version -- : ?
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : not

Hello,

When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)

So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?

Thanks already!

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

12 years 1 month ago [\#175431](#175431) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#175431 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hi,

You can find the file "invoice.php" to generate the PDF invoice from the PDF invoice plugin of Hikashop in the folder plugins/hikashop/attachinvoice/attachinvoice/ of your website.
The order data is available in the variable $order in that file

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

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

Less More

- Posts: 138
- Thank you received: 1
-
-

12 years 1 month ago [\#175565](#175565) by [extreme](/forum/user/27729-extreme "View extreme's Profile")  Replied by *[extreme](/forum/user/27729-extreme "View extreme's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#175565 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hello yes we understand that we have to adapt the invoice.php file. to change the pdf. However there is no data in this file for the comments that people at in the field option at the checkout. This information is only showed in the e-mail not in the pdf!

So we like to know where this e-mail gets his data from. (wich file) and were in this file it is giving info about the extra field part. So we can copy this and put it in the invoice.php file. ![:)](/media/kunena/emoticons/3.png ":)")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 1 month ago -  12 years 1 month ago [\#175571](#175571) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#175571 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hello,

> So we like to know where this e-mail gets his data from. (wich file) and were in this file it is giving info about the extra field part. So we can copy this and put it in the invoice.php file. ![:)](/media/kunena/emoticons/3.png ":)")

You'll just have to edit the "plugins/hikashop/attachinvoice/attachinvoice/**invoice.php**" file, here are the lines which are displaying the "extra field part" : Code:

&lt;fieldset class="hikashop_order_custom_fields_fieldset"&gt; &lt;legend&gt;&lt;?php echo JText::_('ADDITIONAL_INFORMATION'); ?&gt;&lt;/legend&gt; &lt;table class="hikashop_order_custom_fields_table adminlist" cellpadding="1" width="100%"&gt; &lt;?php foreach($fields['order'] as $fieldName =&gt; $oneExtraField) { if(!@$oneExtraField-&gt;field_frontcomp &#124;&#124; empty($order-&gt;$fieldName)) continue; ?&gt; &lt;tr class="hikashop_order_custom_field_&lt;?php echo $fieldName;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;?php echo $fieldsClass-&gt;getFieldName($oneExtraField);?&gt; &lt;/td&gt; &lt;td&gt; &lt;?php echo $fieldsClass-&gt;show($oneExtraField,$order-&gt;$fieldName); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt; &lt;/fieldset&gt;

Last edit: 12 years 1 month ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

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

Less More

- Posts: 138
- Thank you received: 1
-
-

12 years 1 month ago [\#176372](#176372) by [extreme](/forum/user/27729-extreme "View extreme's Profile")  Replied by *[extreme](/forum/user/27729-extreme "View extreme's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176372 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hello,

Thanks for your reaction. We did place the code in the invoice.php file and part of the stuff worked. What happends:

It is showing the first sentence of the extra field name.
It is not showing the second line of the fiels name.
It is also not showing the comment that people put into this field.

The field is also showing in the pdf when people do not put any comment into the field. Wich shouldnt be eather.

How is this possible as it should be the same code?

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

12 years 1 month ago [\#176404](#176404) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176404 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hi,

The forum engine stripped the Code:

['order']

part of the code Mohamed gave you.
I believe that it's why it's not working properly.
Also, there should also be some extra code around that code: Code:

&lt;?php if(hikashop_level(2) &amp;&amp; !empty($fields['order'])){?&gt; &lt;fieldset class="hikashop_order_custom_fields_fieldset"&gt; &lt;legend&gt;&lt;?php echo JText::_('ADDITIONAL_INFORMATION'); ?&gt;&lt;/legend&gt; &lt;table class="hikashop_order_custom_fields_table adminlist" cellpadding="1" width="100%"&gt; &lt;?php foreach($fields['order'] as $fieldName =&gt; $oneExtraField) { if(!@$oneExtraField-&gt;field_frontcomp &#124;&#124; empty($order-&gt;$fieldName)) continue; ?&gt; &lt;tr class="hikashop_order_custom_field_&lt;?php echo $fieldName;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;?php echo $fieldsClass-&gt;getFieldName($oneExtraField);?&gt; &lt;/td&gt; &lt;td&gt; &lt;?php echo $fieldsClass-&gt;show($oneExtraField,$order-&gt;$fieldName); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/table&gt; &lt;/fieldset&gt; &lt;br/&gt; &lt;?php } ?&gt;

Note that this code is already in the attachinvoice/invoice.php file so if you don't have it, it means that you have an old version of the plugin and you might be missing something else in the code of the plugin for that code to work properly.

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

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

Less More

- Posts: 138
- Thank you received: 1
-
-

12 years 1 month ago [\#176530](#176530) by [extreme](/forum/user/27729-extreme "View extreme's Profile")  Replied by *[extreme](/forum/user/27729-extreme "View extreme's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176530 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hi we have the latest update. The code is already in the file but nothing is working. With the first code we got at least a part of the code was showing but right now we dont get any result. The complete extra field is not showing. Is there something blocking it?

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

12 years 1 month ago [\#176665](#176665) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176665 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

When you update HikaShop it doesn't update the PDF invoice plugin. Do you have the latest version of the plugin ?
Do you have the line $fields = $fieldsClass-&gt;getFields('backend',$order,'order'); in the attachinvoice.php file of the plugin ?

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

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

Less More

- Posts: 138
- Thank you received: 1
-
-

12 years 1 month ago [\#176819](#176819) by [extreme](/forum/user/27729-extreme "View extreme's Profile")  Replied by *[extreme](/forum/user/27729-extreme "View extreme's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176819 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

Hi thanks for the answer. No we dont have this in the code so i think we dont have the last plugin. However if i go to our products in the menu above we only see the bussinesupload. NOt the plugin.

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

12 years 1 month ago [\#176825](#176825) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to add extra information field invoice to pdf](/forum/27-checkout/872291-how-to-add-extra-information-field-invoice-to-pdf#176825 "-- HikaShop version -- : 2.3.3 -- Joomla version -- : 2.5.19 -- PHP version -- : ? -- Browser(s) name and version -- : all -- Error-message(debug-mod must be tuned on) -- : not  Hello,  When a customer orders a product in the webshop they get an confirmation e-mail including the pdf. In our webshop it is possible for people to ad some text that gets included in the confirmation e-mail. (this option is called field in the backend of hikashop.)  So whe would like to get this information not only in the e-mail but also in the pdf. However we can not find the code responisble for this. Can you tell uss what the code is or where we can find it?  Thanks already!")*

The PDF invoice sale is not a subscription so that's why you don't see it there.
Please use our contact form to request the latest version with your order number and a link to this thread :
[ www.hikashop.com/support/contact-us.html](http://www.hikashop.com/support/contact-us.html)

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

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