- Posts: 234
- Thank you received: 4
Export csv changing part numbers
10 years 9 months ago #224550
by mad-q
Export csv changing part numbers was created 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
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.
10 years 9 months ago #224552
by Xavier
Replied by Xavier on topic Export csv changing part numbers
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 ?
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.
10 years 9 months ago #224776
by mad-q
Replied by mad-q on topic Export csv changing part numbers
Hello
At first I thought it was Excel however when opened in notepad it has removed the leading zero,
Thanks
Iain
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.
10 years 9 months ago #224777
by nicolas
Replied by nicolas on topic Export csv changing part numbers
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 ?
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.
10 years 9 months ago #224825
by mad-q
Replied by mad-q on topic Export csv changing part numbers
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
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.
10 years 9 months ago #224856
by nicolas
Replied by nicolas on topic Export csv changing part numbers
Hi,
Ok, I see the problem.
Try changing the code:
to:
in the file administrator/components/com_hikashop/helpers/spreadsheet.php and let us know if that works.
Ok, I see the problem.
Try changing the code:
Code:
if( is_numeric($value)) {
$this->writeNumber($this->currLine, $i++, $value, $lastOne);
Code:
if( is_numeric($value) && (preg_match('[^0-9]',$value) || ltrim($value,'0')===(string)$value)) {
$this->writeNumber($this->currLine, $i++, $value, $lastOne);
The following user(s) said Thank You: mad-q
Please Log in or Create an account to join the conversation.
5 years 6 months ago #331177
by grayt7
Replied by grayt7 on topic Export csv changing part numbers
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.
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.
5 years 6 months ago - 5 years 6 months ago #331188
by nicolas
Replied by nicolas on topic Export csv changing part numbers
Hi,
I have tested this on my end with the export of a product with the latest version of HikaShop and I cannot reproduce:
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.
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.
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.289 seconds