Jump to content

[Solved] Product category wrongly assigned to home in CSV import


Recommended Posts

PS Version: 1.6.0.11

I have to import around 1000 products. I have created all the categories with CSV import successfully and currently my category tree looks like below;

 

Home

-Category X

--SubCategory A

---SubSubCategory P

---SubSubCategory Q

--SubCategory B

--SubCategory C

-Category Y

--Subcategory L

--SubCategory M

-Category Z

--SubCategory N

--SubCategory O

 

Now when i add Category X,SubCategory A,SubSubCategory P in category column of CSV of particular product, and after importing the CSV, apart from the categories mentioned in category column in CSV, the products get also assigned to Home category automatically.

 

I have searched a lot through forums, google, but didnt found any solution.

 

Anyone please help me with this.

Edited by madhurna (see edit history)
Link to comment
Share on other sites

I have noticed the exact same behaviour.  It essentially makes the importer unusable for me.  I may have to just write an sql query for the import.

 

I have :

 

Home Category

- Subcategory

- - SubSubCategory1

- - SubSubcategory2

 

Then I manually created over 400 products and for example added Product A into Association to SubSubCategory1 and SubSubcategory2. (it is a consumable that works in both these category items)

 

When I do an import with just product ID and price, which is all I really need to update, the importer wipes my associations.  Which is very silly.  It should simply update the data in the csv I'm importing and leave everything else as is.

  • Like 1
Link to comment
Share on other sites

I'm not able to set default category during CSV import.

I'm currently on 1.6.0.11 with latest githup https://github.com/PrestaShop/PrestaShop/blob/b9437bf7cb07eac86fb3bd5a7b54df13027f617f/controllers/admin/AdminImportController.php

 

My category looks like this 11|12||23|24|25|54   I'm expecting (12) to be the default category since it's the last subcategory in the 1st group separeted by (||).  This is how 1.5 used to work.

Then I tried placing the subcategory that I want to be default (12) first E.g: 12||11|12||23|24|25|54  but nope it doesn't work it still records (11).

 

Please advice.

Link to comment
Share on other sites

I'm not able to set default category during CSV import.

I'm currently on 1.6.0.11 with latest githup https://github.com/PrestaShop/PrestaShop/blob/b9437bf7cb07eac86fb3bd5a7b54df13027f617f/controllers/admin/AdminImportController.php

 

My category looks like this 11|12||23|24|25|54   I'm expecting (12) to be the default category since it's the last subcategory in the 1st group separeted by (||).  This is how 1.5 used to work.

Then I tried placing the subcategory that I want to be default (12) first E.g: 12||11|12||23|24|25|54  but nope it doesn't work it still records (11).

 

Please advice.

I'm using comma to separate two categories f.e. 13,14  or 1,15  first number is default category id

You can also replace line 669 to : $this->addJS(_PS_JS_DIR_.'adminImport.js'); (javaScript and import buttons working) in file that You use

Link to comment
Share on other sites

I'm using comma to separate two categories f.e. 13,14  or 1,15  first number is default category id

You can also replace line 669 to : $this->addJS(_PS_JS_DIR_.'adminImport.js'); (javaScript and import buttons working) in file that You use

 

In my case I have in AdminImportController.php

	public function renderView()
	{
		$this->addJS(_PS_JS_DIR_.'admin/import.js');
Edited by dformica (see edit history)
Link to comment
Share on other sites

 

In my case I have in AdminImportController.php

	public function renderView()
	{
		$this->addJS(_PS_JS_DIR_.'admin/import.js');

Just download the file from "madhurna" and change this line to  669 : $this->addJS(_PS_JS_DIR_.'adminImport.js');

For me works fine, thank you team for fast reaction, I was scared little bit when i saw it first time..))

Link to comment
Share on other sites

  • 1 year later...

Thanks for the response but I think that everyone's problem is that we would like to have the ability to keep our initial id_category_default. Removing massively the superfluous assignment to the home category, is something that could be also be done with a query in the database.

Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...