Column is twice in the CSV File

  • Posts: 96
  • Thank you received: 0
11 years 3 months ago #118892

-- HikaShop version -- : 2.2.0
-- Joomla version -- : 3.1.5
-- PHP version -- : 5.3.8

I am trying to import a CSV file (attached) and I'm getting a series of errors like:
The column "product_code" is twice in your CSV. Only the second column data will be taken into account.
The column "product_parent_id" is twice in your CSV. Only the second column data will be taken into account.

I have tried my CSV file in various combinations. My most recent has double quotes with a semi-colon delimiter, attached.

Thanks,

Scott

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 3 months ago #118908

Hi,

CSV files are not allowed by our Kunena forum. Please put your CSV file in a zip.

Your messages indicates that the columns "product_code" and "product_parent_id" are twice in the file. So I want to say that the problem is that the columns "product_code" and "product_parent_id" are twice in your CSV file.
Please check the first line of your CSV file, checking the columns and remove the duplicates ones.

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.

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

  • Posts: 96
  • Thank you received: 0
11 years 3 months ago #118910

Thank you.

I've reattached the file...no duplicate first line/column names that I can see.

Scott

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 3 months ago #118948

Hi,

Please edit the file "administrator/components/com_hikashop/helper/import.php" and replace the code

			foreach($this->columns as $otherColumn){
				if($this->columns[$i] == strtolower($otherColumn)) {
By:
			foreach($this->columns as $k => $otherColumn){
				if($i != $k && $this->columns[$i] == strtolower($otherColumn)) {
It will solve your problem.
After that, the import should work properly, the warning message is just a warning, it does not affect the rest of the import.

Sorry for the inconvenient.


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.

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

  • Posts: 96
  • Thank you received: 0
11 years 3 months ago #119739

Thank you...this deed indeed remove the error message.

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

  • Posts: 846
  • Thank you received: 92
11 years 3 months ago #119949

piggybank, you say you have many mesage error but you don't say if the import of data is ok ?
Do you succeed to import all the data locate in the csv file even when all this messages occurs ?

Thank's

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #120026

Hello,

I can not find the code you list in my file.

Here is an example of my csv file.

product_name,product_description,product_quantity,product_code,product_published,product_tax_id,categories,price_value,price_currency_id,images,related
Tool box lock and keys N/A,"Sorry, no stock. If you order this we will put it on back order",-1,T2573,1,11,2,0,GBP,T2573.jpg,

Cheers
Iain

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

  • Posts: 2334
  • Thank you received: 403
11 years 3 months ago #120048

Hi lain,

If you don't have the code in your file you''re either editing the wrong file or using an older version.
Try to download the last Hikashop version again an reinstall it.

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

  • Posts: 234
  • Thank you received: 4
11 years 3 months ago #120109

Hello
As per usual you are correct, many thanks.

Iain

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

Time to create page: 0.097 seconds
Powered by Kunena Forum