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

#   Export csv changing part numbers

##

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

Less More

- Posts: 234
- Thank you received: 4
-
-

10 years 10 months ago [\#224550](#224550) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224550 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")* was created by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")*

-- HikaShop version -- : 2.6.0

Hello

I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.

Thanks
Iain

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

10 years 10 months ago [\#224552](#224552) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224552 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hi,

Are you sure that the leading 0 are not removed by you csv file reader ?
Do you have tried to open the csv editor with a text editor like windows notepad ?

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

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

Less More

- Posts: 234
- Thank you received: 4
-
-

10 years 10 months ago [\#224776](#224776) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  Replied by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224776 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hello

At first I thought it was Excel however when opened in notepad it has removed the leading zero,

Thanks
Iain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84ODExNjUtZXhwb3J0LWNzdi1jaGFuZ2luZy1wYXJ0LW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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: 86365
- Thank you received: 14297
-
-

10 years 10 months ago [\#224777](#224777) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224777 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hi,

How do you export your CSV ? What do you mean by "part number" ? The product code of the products ?
Could you provide a copy of the CSV ?

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

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

Less More

- Posts: 234
- Thank you received: 4
-
-

10 years 10 months ago [\#224825](#224825) by [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")  Replied by *[mad-q](/forum/user/4784-mad-q "View mad-q's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224825 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hello,

Yes product code, I am going into Orders, and selecting export. Please find attached the file.
The product code 546 is actually on the site 0546.

Yours
Iain

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84ODExNjUtZXhwb3J0LWNzdi1jaGFuZ2luZy1wYXJ0LW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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: 86365
- Thank you received: 14297
-
-

10 years 10 months ago [\#224856](#224856) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#224856 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hi,

Ok, I see the problem.
Try changing the code: Code:

if( is_numeric($value)) { $this-&gt;writeNumber($this-&gt;currLine, $i++, $value, $lastOne);

to: Code:

if( is_numeric($value) &amp;&amp; (preg_match('[^0-9]',$value) &#124;&#124; ltrim($value,'0')===(string)$value)) { $this-&gt;writeNumber($this-&gt;currLine, $i++, $value, $lastOne);

in the file administrator/components/com_hikashop/helpers/spreadsheet.php and let us know if that works.

The following user(s) said Thank You: [mad-q](/forum/user/4784-mad-q "View mad-q's Profile")

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

- **[grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")**
- [![grayt7's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar30010.jpg)](/forum/user/30010-grayt7 "View grayt7's Profile")
- [ Offline](/forum/user/30010-grayt7)

Less More

- Posts: 376
- Thank you received: 7
-
-
- [](http://www.identitywebdesign.com)
-

5 years 7 months ago [\#331177](#331177) by [grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")  Replied by *[grayt7](/forum/user/30010-grayt7 "View grayt7's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#331177 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

This also happens with 0's at the end of the product code;

example:

Product code 100294.110 is returned 100294.11 in the csv.

Yes I have checked this in notepad.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ltcG9ydC1leHBvcnQtY3N2LXhscy84ODExNjUtZXhwb3J0LWNzdi1jaGFuZ2luZy1wYXJ0LW51bWJlcnM/dG1wbD1tYXJrZG93bg==) 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: 86365
- Thank you received: 14297
-
-

5 years 7 months ago -  5 years 7 months ago [\#331188](#331188) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Export csv changing part numbers](/forum/37-import-export-csv-xls/881165-export-csv-changing-part-numbers#331188 "-- HikaShop version -- : 2.6.0  Hello  I am exporting my orders however it removes any leading zero from the part numbers. How can I get it to not do this as my part numbers need the leading zero.  Thanks Iain")*

Hi,

I have tested this on my end with the export of a product with the latest version of HikaShop and I cannot reproduce:
*This attachment is hidden for guests.
Please log in or register to see it.*

So I can only guess that you have a view override of product / export.php from an old version of HikaShop, or an old version of HikaShop and thus you're missing some of the fixes we've added to it.

Last edit: 5 years 7 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

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

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

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