NopCommerce 4.1 cannot import Categories or Products if the same name is listed twice under different categories

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
When trying to import products into a site that has for example, the name tables under two or more categories or sub-categories, I get the following error? I did not have this problem with earlier versions.

Categories with the same name are not supported in the same category level. Check your category list in "Catalog -> Categories" page


For example,

Classroom Furniture >> Early Ed >> Tables


Classroom Furniture >> Tables

Classroom Furniture >> Tables >> Activity Tables


Art/Music >> Tables


Science Labs >> Tables

Can anyone help?
4 years ago
I even made each category name unique and still the products will not import, even if I just import 1 row and setting it to a unique category.
4 years ago
imported unique categories in Nopcommerce 4.1, checked the DB, every category name is unique, yet when I try to import products, I get this error :
Categories with the same name are not supported in the same category level. Check your category list in "Catalog -> Categories" page


Why would this be? is Nop running out of memory? I have noticed that I have to import the category list TWICE, the first time I get errors that some categories have not loaded, so I import the same XLS file again and it loads without error?


Any idea what is going on?

Thanks,
4 years ago
Check the System Log message to see if there is more detail.  Post it here
4 years ago
Thanks for the response. When I import a category XLS file with unique category and sub-category names, this is the error I get. I have to restart the application each time I want to import categories because if I don't, it does not load as many categories as it does when the site is restarted. if I import a 2nd, 3rd, and 4th time, all the categories eventually import but then I am not able to import products because I get an error that I have duplicate categories. I would like to keep the same name under different parent categories but it seems I am unable to do so. for example, I would like to have "Storage" under Classrooms and Media.


Error
Short message

System.ArgumentException: Categories with the following names aren't imported - Accessories, Accessories & Components, Activity Tables, Art Seating, Art Storage, Art Tables, Big & Tall/Bariatric, Bookcases, Bookcases/Shelving, Borads Technology, Bulletin Boards, Cabinets, Café Tables, Carrels, Circulation Desk, Combination, Computer Tables, Conference, Conference Boards, Conference Chairs, Corkboards, Cubicles, Demonstration & Instruction, Drafting Tables, Drying Racks, Fixed Tables, Flip Top Tables, Folding, Guest Seating, Hutches, Instrument Storage, Lounge & Reception Seating, Maker Space, Managers & Executive Seating, Media Chairs, Media Soft Seating, Media Tables, Mobile Cafeteria Tables, Mobile Convertible Tables, Office Desks, Office Seating, Office Sofas & Loveseats, Office Stack Chairs, Office Storage, Office Tables, Office Task Chairs, Office Workstations, Open Storage, Partitions, Pedestals, Podiums, Reception, Reception Desks, Reception Seating, Reception Tables, Replacements & Skins, Risers/Stages, Science Seating, Science Stools, Science Storage, Science Tables, Sit/Stand Desks, Sit/Stand Tables, Stem/Steam, Student Desks, Supplies, Systems, Teacher’s Desks, Training/Seminar Tables, Trophy Cases, Whiteboards, Workstations
   at Nop.Services.ExportImport.ImportManager.ImportCategoriesFromXlsx(Stream stream) in C:\andrei\nopcommerce\sources\src\Libraries\Nop.Services\ExportImport\ImportManager.cs:line 2094
   at Nop.Web.Areas.Admin.Controllers.CategoryController.ImportFromXlsx(IFormFile importexcelfile) in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web\Areas\Admin\Controllers\CategoryController.cs:line 473
4 years ago
Here is list of all the category names, you will see that each name is in fact unique so I must be missing something.

Name
"Wobble" Chairs/Stools
Accessories
Accessories & Components
Activity Tables
Art
Art Seating
Art Storage
Art Tables
Art/Music
Big & Tall/Bariatric
Boards
Boards Technology
Bookcases
Bookcases/Shelving
Bulletin Boards
Cabinets
Café Tables
Carpets
Carrels
Circulation Desk
Classroom Carpets
Classroom Furniture
Classroom Storage
Classroom Tables
Combination
Combos
Computer Tables
Conference
Conference Boards
Conference Chairs
Corkboards
Cubicles
Demonstration & Instruction
Desks
Drafting Tables
Dramatic Play
Drying Racks
Early Ed
Early Ed Chairs
Early Ed Lockers
Early Ed Storage
Early Ed Tables
Easels
Fixed Tables
Flip Top Tables
Folding
Folding Chairs
Guest Seating
Hutches
Infants & Toddlers
Instrument Storage
Literacy
Lockers
Lounge & Reception Seating
Maker Space
Managers & Executive Seating
Media Center
Media Chairs
Media Soft Seating
Media Tables
Mobile Cafeteria Tables
Mobile Convertible Tables
Office
Office Desks
Office Seating
Office Sofas & Loveseats
Office Stack Chairs
Office Storage
Office Tables
Office Task Chairs
Office Workstations
Open Storage
Outdoor
Partitions
Pedestals
Podiums
Reception
Reception Desks
Reception Seating
Reception Tables
Replacements & Skins
Risers/Stages
Science Labs
Science Seating
Science Stools
Science Storage
Science Tables
Seating
Sit/Stand Desks
Sit/Stand Tables
Sofas & Loveseats
Soft Seating
Stack Chairs
Stem/Steam
Stools
Storage
Student Desks
Supplies
Systems
Task Chairs
Teacher’s Desks
Teachers
Technology
Training/Seminar Tables
Trophy Cases
Whiteboards
Workstations
4 years ago
im getting this error on 4.2 also.

did you find out why this happens?
4 years ago
I had to break the category import up in to multiple files. for example, categories 1-10 in one file and 10-20 in another file. I think it may have something to do with the shared hosting I am, where Nopcommerce is not getting the resources it needs. This was not a problem with a dedicated machine. You should also be able to reimport a category xls file, if the category exists it should update and if it does not it will add. I did the same with the products load. Broke up the file into many different files. Also make sure the category name is spelled exactly as it is loaded into Nop. I had some issue with quotes. if the quote is different than was what loaded, it will not find the category.
4 years ago
Hi I'm getting the same error with 4,2 version. Any idea how to fix it?

Categories with the same name are not supported in the same category level. Check your category list in "Catalog -> Categories" page
complete message:  
System.ArgumentException: Categories with the same name are not supported in the same category level. Check your category list in "Catalog -> Categories" page
   at Nop.Services.ExportImport.ImportManager.ImportProductsFromXlsx(Stream stream)
   at Nop.Web.Areas.Admin.Controllers.ProductController.ImportExcel(IFormFile importexcelfile) in C:\andrei\nopcommerce\sources\src\Presentation\Nop.Web\Areas\Admin\Controllers\ProductController.cs:line 2280
4 years ago
Looks like you cannot have the same category name at the same level, for example:

Art >> Music >> subcategory1
Art >> Music >> subcategory1

if you have the same category name, make sure it is unique, for example, you can have "
Storage" multiple times but they have to be under different categories, for example: see "Storage" below

Classroom Furniture >> Early Ed >> Storage


Classroom Furniture >> Storage >> Open Storage


Art/Music >> Storage >> Instrument Storage


Science Labs >> Storage


Office >> Storage


Storage


hope this helps.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.