Skip to main content

Export csv changing part numbers

More
10 years 9 months ago #224550 by mad-q
-- 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 or Create an account to join the conversation.

More
10 years 9 months ago #224552 by Xavier
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 or Create an account to join the conversation.

More
10 years 9 months ago #224776 by mad-q
Hello

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

Thanks
Iain

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #224777 by nicolas
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 or Create an account to join the conversation.

More
10 years 9 months ago #224825 by mad-q
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 or Create an account to join the conversation.

More
10 years 9 months ago #224856 by nicolas
Hi,

Ok, I see the problem.
Try changing the code:
Code:
if( is_numeric($value)) { $this->writeNumber($this->currLine, $i++, $value, $lastOne);
to:
Code:
if( is_numeric($value) && (preg_match('[^0-9]',$value) || ltrim($value,'0')===(string)$value)) { $this->writeNumber($this->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

Please Log in or Create an account to join the conversation.

More
5 years 6 months ago #331177 by grayt7
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 or Create an account to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #331188 by nicolas
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 6 months ago by nicolas.
The following user(s) said Thank You: grayt7

Please Log in or Create an account to join the conversation.

Time to create page: 0.213 seconds
Powered by Kunena Forum