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

#   Small suggestion regarding store address formatting in PDF invoice

##

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 637
- Thank you received: 26
-
-
-

5 months 2 weeks ago [\#371951](#371951) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  *[Small suggestion regarding store address formatting in PDF invoice](/forum/50-feature-request/910530-small-suggestion-regarding-store-address-formatting-in-pdf-invoice#371951 "Hi,  First of all, thanks a lot for the PDF invoice plugin — it's been really helpful in my projects.  While customising the invoice template for one of my clients, I noticed something small that you might want to look into when you have a moment. The store address from the HikaShop configuration is printed on a single line in the generated PDF, even though the address in the config contains line breaks. Ideally those line breaks would show up on the invoice as well.  Looking at the code with AI in plugins/hikashop/attachinvoice/attachinvoice/invoice.php (around line 134), I think it might be related to this line:  $store = str&#95;replace(array('&#92;r&#92;n','&#92;n','&#92;r'),array('','',''),$config-&gt;get('store&#95;address',''));  If I'm reading it correctly (read AI ;-), the search strings are wrapped in single quotes, which in PHP means the &#92;r and &#92;n are interpreted as literal characters (backslash + letter) rather than actual newline characters. Since the address in the config contains real newlines, the replacement doesn't find a match.")* was created by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")*

Hi,

First of all, thanks a lot for the PDF invoice plugin — it's been really helpful in my projects.

While customising the invoice template for one of my clients, I noticed something small that you might want to look into when you have a moment. The store address from the HikaShop configuration is printed on a single line in the generated PDF, even though the address in the config contains line breaks. Ideally those line breaks would show up on the invoice as well.

Looking at the code with AI in plugins/hikashop/attachinvoice/attachinvoice/invoice.php (around line 134), I think it might be related to this line:

$store = str_replace(array('\r\n','\n','\r'),array('&lt;br/&gt;','&lt;br/&gt;','&lt;br/&gt;'),$config-&gt;get('store_address',''));

If I'm reading it correctly (read AI ![;-)](/media/kunena/emoticons/24.png ";-)"), the search strings are wrapped in single quotes, which in PHP means the \r and \n are interpreted as literal characters (backslash + letter) rather than actual newline characters. Since the address in the config contains real newlines, the replacement doesn't find a match.

---

Kind regards,
Lumiga

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MTA1MzAtc21hbGwtc3VnZ2VzdGlvbi1yZWdhcmRpbmctc3RvcmUtYWRkcmVzcy1mb3JtYXR0aW5nLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86323
- Thank you received: 14283
-
-

5 months 2 weeks ago [\#371952](#371952) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Small suggestion regarding store address formatting in PDF invoice](/forum/50-feature-request/910530-small-suggestion-regarding-store-address-formatting-in-pdf-invoice#371952 "Hi,  First of all, thanks a lot for the PDF invoice plugin — it's been really helpful in my projects.  While customising the invoice template for one of my clients, I noticed something small that you might want to look into when you have a moment. The store address from the HikaShop configuration is printed on a single line in the generated PDF, even though the address in the config contains line breaks. Ideally those line breaks would show up on the invoice as well.  Looking at the code with AI in plugins/hikashop/attachinvoice/attachinvoice/invoice.php (around line 134), I think it might be related to this line:  $store = str&#95;replace(array('&#92;r&#92;n','&#92;n','&#92;r'),array('','',''),$config-&gt;get('store&#95;address',''));  If I'm reading it correctly (read AI ;-), the search strings are wrapped in single quotes, which in PHP means the &#92;r and &#92;n are interpreted as literal characters (backslash + letter) rather than actual newline characters. Since the address in the config contains real newlines, the replacement doesn't find a match.")*

Hi,

Thanks for the report. On our end the default invoice.php of the PDF invoice plugin already converts the store address line breaks correctly (it uses the right syntax), so we cannot reproduce the single line issue with a current version.

If you see single quotes there, you are most likely on a quite old version of the plugin, or on a customized / overridden invoice.php on that site. Could you check that the PDF invoice plugin is up to date, and if you have a custom invoice template, that its store address line matches the current default one?

Still, we've found that the issue is there for other invoice layouts of the plugin so we've made a new version for these following your feedback.

The following user(s) said Thank You: [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MTA1MzAtc21hbGwtc3VnZ2VzdGlvbi1yZWdhcmRpbmctc3RvcmUtYWRkcmVzcy1mb3JtYXR0aW5nLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")**
- [![Lumiga's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar31479.png)](/forum/user/31479-lumiga "View Lumiga's Profile") Topic Author
- [ Offline](/forum/user/31479-lumiga)

Less More

- Posts: 637
- Thank you received: 26
-
-
-

5 months 2 weeks ago [\#371963](#371963) by [Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")  Replied by *[Lumiga](/forum/user/31479-lumiga "View Lumiga's Profile")* on topic *[Small suggestion regarding store address formatting in PDF invoice](/forum/50-feature-request/910530-small-suggestion-regarding-store-address-formatting-in-pdf-invoice#371963 "Hi,  First of all, thanks a lot for the PDF invoice plugin — it's been really helpful in my projects.  While customising the invoice template for one of my clients, I noticed something small that you might want to look into when you have a moment. The store address from the HikaShop configuration is printed on a single line in the generated PDF, even though the address in the config contains line breaks. Ideally those line breaks would show up on the invoice as well.  Looking at the code with AI in plugins/hikashop/attachinvoice/attachinvoice/invoice.php (around line 134), I think it might be related to this line:  $store = str&#95;replace(array('&#92;r&#92;n','&#92;n','&#92;r'),array('','',''),$config-&gt;get('store&#95;address',''));  If I'm reading it correctly (read AI ;-), the search strings are wrapped in single quotes, which in PHP means the &#92;r and &#92;n are interpreted as literal characters (backslash + letter) rather than actual newline characters. Since the address in the config contains real newlines, the replacement doesn't find a match.")*

Hi,

Yes you are right, I didn't used the invoice.php (that was a mistake from AI) in my case it was the corporate invoice.

Thanks a lot for the fix.

Kind regards,
Lumiga

---

Kind regards,
Lumiga

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC85MTA1MzAtc21hbGwtc3VnZ2VzdGlvbi1yZWdhcmRpbmctc3RvcmUtYWRkcmVzcy1mb3JtYXR0aW5nLWluLXBkZi1pbnZvaWNlP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.096 seconds

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