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

#   Exportin product\_code looses 0 in front of number

##

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

Less More

- Posts: 640
- Thank you received: 16
-
-

10 years 11 months ago [\#223589](#223589) by [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")  *[Exportin product\_code looses 0 in front of number](/forum/37-import-export-csv-xls/880997-exportin-product-code-looses-0-in-front-of-number#223589 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  I have to export products that can include a 0 at the start of the product code - 00250  HikaShop is managing them correctly inside the HikaShop universe but when exporting to CSV is loosing the zeros in front so a 00250 is reduced to 250.  I analyzed the result file with plain text editor so it is not a missconversion from excel.  How can this be fixed?")* was created by *[PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")*

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5

I have to export products that can include a 0 at the start of the product code - 00250

HikaShop is managing them correctly inside the HikaShop universe but when exporting to CSV is loosing the zeros in front so a 00250 is reduced to 250.

I analyzed the result file with plain text editor so it is not a missconversion from excel.

How can this be fixed?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 11 months ago [\#223617](#223617) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Exportin product\_code looses 0 in front of number](/forum/37-import-export-csv-xls/880997-exportin-product-code-looses-0-in-front-of-number#223617 "-- HikaShop version -- : 2.6.0 -- Joomla version -- : 3.4.5  I have to export products that can include a 0 at the start of the product code - 00250  HikaShop is managing them correctly inside the HikaShop universe but when exporting to CSV is loosing the zeros in front so a 00250 is reduced to 250.  I analyzed the result file with plain text editor so it is not a missconversion from excel.  How can this be fixed?")*

Hi,

It comes from the HikaShop spreadsheet helper Code:

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

The value is considered as numeric by the PHP "is_numeric" function, so a number is added in the export file.
I suppose that a check as to be added to avoid that specific case.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [PeterChain](/forum/user/570-peterchain "View PeterChain's Profile")

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

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