Exportin product_code looses 0 in front of number

  • Posts: 634
  • Thank you received: 16
8 years 11 months ago #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?

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #223617

Hi,

It comes from the HikaShop spreadsheet helper

	if( is_numeric($value) ) {
		$this->writeNumber($this->currLine, $i++, $value, $lastOne);
	} else {
		$this->writeText($this->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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain

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

Time to create page: 0.053 seconds
Powered by Kunena Forum